logrotate | logrotate utility is designed to simplify

 by   logrotate C Version: 3.21.0 License: GPL-2.0

kandi X-RAY | logrotate Summary

kandi X-RAY | logrotate Summary

logrotate is a C library typically used in Logging, Nodejs applications. logrotate has no bugs, it has no vulnerabilities, it has a Strong Copyleft License and it has medium support. You can download it from GitHub.

The logrotate utility is designed to simplify the administration of log files on a system which generates a lot of log files. Logrotate allows for the automatic rotation compression, removal and mailing of log files. Logrotate can be set to handle a log file hourly, daily, weekly, monthly or when the log file gets to a certain size.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              logrotate has a medium active ecosystem.
              It has 1037 star(s) with 184 fork(s). There are 25 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 29 open issues and 207 have been closed. On average issues are closed in 734 days. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of logrotate is 3.21.0

            kandi-Quality Quality

              logrotate has 0 bugs and 0 code smells.

            kandi-Security Security

              logrotate has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              logrotate code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              logrotate is licensed under the GPL-2.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              logrotate releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of logrotate
            Get all kandi verified functions for this library.

            logrotate Key Features

            No Key Features are available at this moment for logrotate.

            logrotate Examples and Code Snippets

            No Code Snippets are available at this moment for logrotate.

            Community Discussions

            QUESTION

            mariadb slow query not logged
            Asked 2022-Mar-03 at 05:56

            As the title suggests, no log is recorded in the log file even though the related settings have been completed.

            ...

            ANSWER

            Answered 2022-Mar-03 at 05:56

            The new settings will apply only if the MariaDB server instance is restarted. Therefore, the solution, as mentioned in the comment, is to restart the MariaDB server instance in order to apply the new settings.

            Source https://stackoverflow.com/questions/71317902

            QUESTION

            Async Log4J2 and logrotate not working correctly (truncate is broken)
            Asked 2022-Feb-16 at 07:50

            I am using Log4J2 async logger to log my Java application and I'm using logrotate to store the old logs everyday.

            Previously, I was using Log4J2 synchronously and everything worked fine; since I switched to async logging logrotate stopped working correctly.

            I think I am experiencing the same issue explained here: since I am using the copytruncate option, the old log file gets truncated after being copied, but the logger doesn't know it, so it continues writing starting from the "old" index, thus filling all the previous space in the file with NUL values, which is exactly what I'm seeing.

            This is the command I am launching my application with:

            ...

            ANSWER

            Answered 2022-Feb-16 at 07:50

            You should replace the RandomAccessFileAppender with a simple FileAppender.

            Your issue is not caused by the use of asynchronous loggers, but by the appender you use:

            • Java's RandomAccessFile, which is used by the RandomAccessFileAppender opens files in read/write mode without the O_APPEND option (cf. open(2)),
            • FileOutputStream, which is used by the usual FileAppender, opens files in write only mode with the O_APPEND option.

            The presence or the absence of this option influences how writes are performed:

            O_APPEND The file is opened in append mode. Before each write(2), the file offset is positioned at the end of the file, as if with lseek(2). The modification of the file offset and the write operation are performed as a single atomic step.

            (from man open(2)).

            When you truncate your log file a FileAppenders offset will be reset to 0, while a RandomAccessFileAppender will continue writing at the previous position.

            Remark: Log4j also provides a RollingFileAppender, which will remove the need to use logrotate at all.

            Edit: the exact options used to create the objects used by the managers can be found:

            Source https://stackoverflow.com/questions/71128523

            QUESTION

            How to truncate an existing and opened file using Ansible?
            Asked 2022-Jan-08 at 10:48

            I like to truncate or resize an already existing file which is opened and used by an other application. In example, the disk may be cluttered with log files taking up large amounts of space over time like /var/log/secure.

            In plain Linux the equivalent would be

            ...

            ANSWER

            Answered 2022-Jan-07 at 13:44

            It seems that Ansible Issue #902 wasn't implemented in that way.

            However, as of Ansible v3.0.0, with filesize_module, a simple wrapper around dd to create, extend or truncate a file, given its size, was introduced.

            It can be used to manage swap files (that require contiguous blocks) or alternatively, huge sparse files.

            See filesize.py under /ansible-collections/community.general/blob/main/plugins/modules/files/ for more information.

            Source https://stackoverflow.com/questions/70621828

            QUESTION

            QNX Slogger2 Vs Syslog
            Asked 2021-Dec-23 at 18:52

            What is the difference between Slogger2 (System Logger) and Linux based syslog?

            I understand the difference between journald and syslog. Slogger2 also gives a way to redirect syslog messages to slogger2.

            Is it QNX's version of syslog as it deals with palin text files? Does Does it also uses logrotate like tool to handle file size?

            ...

            ANSWER

            Answered 2021-Dec-23 at 18:52

            slogger2 (and it's predecessor slogger) provide a low-latency in-memory log system. slogger2 is closer conceptually to the Linux kernel log service (eg. slog2f() is approximately equivalent to printk()), but runs as a user-space daemon independent of the kernel as QNX uses a microkernel architecture.

            Like the Linux kernel log, slogger2 does not write messages to disk by itself; if you want to store messages in a file, you are required to run another process to manage that (ie. slog2info is analogous to klogd). It is possible to route syslog into slogger2, to have a single source of message traffic; it is also possible to route slogger2 to syslog, to leverage syslogd's better tools for writing files to disk.

            Source https://stackoverflow.com/questions/70452458

            QUESTION

            ServiceUnavailable: WebSocket connection failure after :server connect for neo4j
            Asked 2021-Dec-21 at 14:21

            I want to launch Neo4j on my machine with dokcer. I downloaded it and did it:

            ...

            ANSWER

            Answered 2021-Dec-21 at 14:21

            You also need to expose the bolt port from the docker container. The default bolt port is 7687.

            Source https://stackoverflow.com/questions/70424753

            QUESTION

            when I click a project : 500 Whoops, something went wrong on our end
            Asked 2021-Oct-28 at 16:29

            hellow every one i migrated gitlab-ce into a new instance with new domain name using backup/restore

            my problem : when i click a project it gives me "500 Whoops, something went wrong on our end "

            i installed the same gitlab-ce version in the new host which is 13.6.2

            my gitlab status

            ...

            ANSWER

            Answered 2021-Oct-28 at 16:29

            To fix this problem I had to migrate gitlab-secrets.json from /etc/gitlab too, because this file contains the database encryption key, CI/CD variables, and variables used for two-factor authentication.
            If you fail to restore this encryption key file along with the application data backup, users with two-factor authentication enabled and GitLab Runner lose access to your GitLab server.

            Source https://stackoverflow.com/questions/69525251

            QUESTION

            Why logrotate doesn't properly postrotate only has 1 day delay
            Asked 2021-Sep-29 at 19:36

            I have in /etc/logrotate.d/mikrotik :

            ...

            ANSWER

            Answered 2021-Sep-29 at 19:36

            Problem solved.

            It relied on the order in which the operations were performed. Lgrotate does a 'postrotate' section before compressing to .gz. The solution to the problem was to change the name from 'postrotate' to 'lastaction'.

            Source https://stackoverflow.com/questions/69333923

            QUESTION

            Need help sorting array in perl
            Asked 2021-Sep-12 at 18:43

            using s perl script to parse an isc dhcp log, an merge it into a html table. so far so good, works as it should. in the script is an option to sort the results by ip adress. the result is not sorted by the last ip octet, so it will look like this:

            192.168.250.149 192.168.250.2 192.168.250.228 and so on..

            my skills in perl are very limited, so i need help to achieve this. this is the code part:

            ...

            ANSWER

            Answered 2021-Sep-12 at 18:43

            You may use Socket's inet_aton

            I think this is the way to get the keys of the hash sorted by the ip:

            EDIT: Changed <=> in the sort to cmp as per HugoBoss's remarks below.

            Source https://stackoverflow.com/questions/69152944

            QUESTION

            Getting SOURCES from dynamic subdirectories
            Asked 2021-Sep-10 at 16:10

            I need to build multiple RPM packages. But it's getting a missing file as it is searching in the /SOURCES/ directory instead of searching in the respective subdirectory. Is there any way to solve it without touching the spec files, with rpm macros?

            After executing rpmbuild -bb ~/rpmbuild/SPECS/*.spec getting the following error:

            ...

            ANSWER

            Answered 2021-Sep-10 at 16:10

            I think you should redefine the _sourcedir macro this way:

            Source https://stackoverflow.com/questions/69095911

            QUESTION

            pure-ftpd logs into rolled log file (logrotate.d)
            Asked 2021-Aug-23 at 18:24

            we have quite a large system that relies on FTP messaging. /var/log/pureftpd.log is under surveillance to respond to specific actions.

            Currently, I noticed an interesting problem where pure-ftpd is logging a new events to the old logfile for example (pureftpd.log.1).

            This happens in situations when FTP connection is open for a long time. When logrotate rotates log file by renaming old log. It seems that currently active FTP connections are still linked to the old file and all events are written there. This will get fixed after the FTP client reconnects.

            This behaviour makes pureftpd surveilance fail to register some events.

            How it can be fixed using logrotate.d or another means to ensure that all new events are always written into proper logfile without reconnecting ftp clients?

            pure-ftpd is running on Default settings and logrotate configuration is as follow:

            ...

            ANSWER

            Answered 2021-Aug-23 at 18:24

            This is common behavior for processes that open file descriptors to write; logrotate does not deal with these open handles, as such they will 'follow' along to the newly rotated file. Hence the behavior your seeing.

            I assume that you have to either reload or restart the pure-ftpd daemon itself after rotating the file, e.g. assuming systemd:

            Source https://stackoverflow.com/questions/68861605

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install logrotate

            The latest release is:.
            logrotate-3.18.1 (sig) (Changelog)
            logrotate-3.18.0 (sig) (Changelog)
            logrotate-3.17.0 (sig) (Changelog)
            logrotate-3.16.0 (sig) (Changelog)
            logrotate-3.15.1 (sig) (Changelog)
            logrotate-3.15.0 (sig) (Changelog)
            logrotate-3.14.0 (sig) (Changelog)
            logrotate-3.13.0 (sig) (Changelog)
            logrotate-3.12.3 (sig) (Changelog)
            logrotate-3.12.2 (sig) (Changelog)
            logrotate-3.12.1 (sig) (Changelog)
            logrotate-3.12.0 (sig) (Changelog)
            logrotate-3.11.0 (sig) (Changelog)
            logrotate-3.10.0 (Changelog)
            logrotate-3.9.2 (Changelog)

            Support

            Open issues or pull requests on GitHub.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries