PHPackages                             travelport-czech/tplogtools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. travelport-czech/tplogtools

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

travelport-czech/tplogtools
===========================

Tools for manage log files.

1.0.2(6y ago)02.7kMITPython

Since Feb 15Pushed 6y ago3 watchersCompare

[ Source](https://github.com/Travelport-Czech/tplogtools)[ Packagist](https://packagist.org/packages/travelport-czech/tplogtools)[ RSS](/packages/travelport-czech-tplogtools/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

tplogtools
==========

[](#tplogtools)

- [logclean](#logclean) - Removes old files from the specified paths according to the criteria of the limits.
- [stdout2log](#stdout2log) - Tool for store stdin to rotated file.
- [logtime](#logtime) - Inserts the current time before each input line
- [logrot](#logrot) - Move big or overtimed logs to backup

logclean
--------

[](#logclean)

```
logclean [{-n|--dry-run}] [{-f|--force}] [limits] path...

Removes old files from the specified paths according to the criteria of the limits.
The meaning of the parameter is:
  -n, --dry-run                    no file will be deleted, the tool will only list what it would do
  -f, --force                      ignores if any of the specified paths does not exist
                                   (applicable to logclean -f /tmp/a.* when it does not throw an error, even if file matching the mask in /tmp is not)
Limits are defined by parameters (separated by space integer value after each parameter):
  -p, --min-free-space-on-device   defines how many percent of the block device on which the scanned files are to remain free
                                   (default: 0)
  -c, --min-files-per-group        the number of the most recent files in each group that will never be deleted
                                   (default: 0)
  -m, --min-file-age               the number of days the file will not be deleted even if there is not enough free space left on the device
                                   (default: 0)
  -t, --max-file-age               the number of days after which the file will be deleted, even if there is enough space left on the device
                                   (default: 99999)

```

For example, if you want to delete all files from the old-logs directory, older than 10 days:

```
  logclean -t 10 old-logs

```

if we want to keep at least 3 files of each type:

```
  logclean -t 10 -c 3 old-logs

```

if we want to keep at least 10 % of free space on the log disc, but we also need history for at least 3 days:

```
  logclean -p 10 -m 3 old-logs

```

stdout2log
----------

[](#stdout2log)

```
usage: stdout2log [-h] -t TIME [-s SIZE] -b BACKUP [-c COMPRESS] filename

Tool for store stdin to rotated file.

positional arguments:
  filename              Live log filename.

optional arguments:
  -h, --help            show this help message and exit
  -t TIME, --time TIME  Time to rotation in form HH:MM
  -s SIZE, --size SIZE  Max size of live log in MiB
  -b BACKUP, --backup BACKUP
                        Mask for rotated log filename
  -c COMPRESS, --compress COMPRESS
                        Command for compression of rotated log

```

logtime
-------

[](#logtime)

```
usage: logtime [-h]

Inserts the current time before each input line

optional arguments:
  -h, --help  show this help message and exit

```

Example:

```
$ tar czvf sample.tgz /usr/share | ./logtime
2020-01-21T12:13:17.075558+01:00 /usr/share/
2020-01-21T12:13:17.190862+01:00 /usr/share/aclocal/
2020-01-21T12:13:17.190948+01:00 /usr/share/aclocal/libtool.m4
2020-01-21T12:13:18.101484+01:00 /usr/share/aclocal/inttypes_h.m4
2020-01-21T12:13:18.193696+01:00 /usr/share/aclocal/wchar_t.m4
2020-01-21T12:13:18.337082+01:00 /usr/share/aclocal/lib-prefix.m4
2020-01-21T12:13:18.654403+01:00 /usr/share/aclocal/ltdl.m4
2020-01-21T12:13:18.756979+01:00 /usr/share/aclocal/lib-link.m4
2020-01-21T12:13:18.825651+01:00 /usr/share/aclocal/glib-gettext.m4
2020-01-21T12:13:18.864213+01:00 /usr/share/aclocal/progtest.m4
...

```

logrot
------

[](#logrot)

```

usage: logrot [-h] -c CONF [--hourly | --daily] path [path ...]

Move big or overtimed logs to backup

positional arguments:
  path                  Path to folder with log

optional arguments:
  -h, --help            show this help message and exit
  -c CONF, --conf CONF  Path to config yml file
  --hourly              Use rules configured as "hourly"
  --daily               Use rules configured as "daily"

```

Config sample:

```
defaults:
  ignore: False
  min_size: 1M
  max_size: 4G
  interval: daily
  exec_pre: ''
  exec_post: ''
  target: '{{path}}/oldlogs/{{name}}-%Y%m%d-%H:%M.{{ext}}'
  compress: 'bzip2'
specific:
  - mask:
    - httpd-*.log
    - nginx_*.log
    - php_*.log
    - console.log
    ignore: True
  - mask:
    - logfile.log
    exec_post: 'sendHupToFileUsers ao3Restart'
    interval: hourly
    min_size: 500M

```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2278d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0cb21a92e38fbe9525b9ed58e2515215004b27b41b5db1226ebf67289a172859?d=identicon)[srbt](/maintainers/srbt)

---

Top Contributors

[![srbt](https://avatars.githubusercontent.com/u/8090960?v=4)](https://github.com/srbt "srbt (9 commits)")

### Embed Badge

![Health badge](/badges/travelport-czech-tplogtools/health.svg)

```
[![Health](https://phpackages.com/badges/travelport-czech-tplogtools/health.svg)](https://phpackages.com/packages/travelport-czech-tplogtools)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
