Skip to content

[JENKINS-8641] Add a logrotate definition to the Jenkins Debian package definition (similar to Apache, cron-apt, aptitude and apt) #15582

Closed

Description

@jenkins-infra-bot

The Debian package is a great convenience for me. It configures a user, registers the daemon, and makes installation and upgrade wonderful on Debian. I was surprised when I discovered /var/log/jenkins/jenkins.log with over 2 GB of log information on my machine.

Other Debian packages seem to have some ability to configure their logrotate settings automatically (like Apache, apt, ppp, etc.). It would be nice if Jenkins could do the same.


Originally reported by -1, imported from: Add a logrotate definition to the Jenkins Debian package definition (similar to Apache, cron-apt, aptitude and apt)
  • assignee: resmo
  • status: Closed
  • priority: Trivial
  • component(s): core
  • resolution: Fixed
  • resolved: 2011-06-03T16:13:48+00:00
  • votes: 4
  • watchers: 6
  • imported: 2025-11-24
Raw content of original issue

The Debian package is a great convenience for me. It configures a user, registers the daemon, and makes installation and upgrade wonderful on Debian. I was surprised when I discovered /var/log/jenkins/jenkins.log with over 2 GB of log information on my machine.

Other Debian packages seem to have some ability to configure their logrotate settings automatically (like Apache, apt, ppp, etc.). It would be nice if Jenkins could do the same.

  • environment: Debian Linux i386 and AMD64

Activity

  1. jenkins-infra-bot commented on Feb 4, 2011

    @jenkins-infra-bot
    Author
    kohsuke:
    • Original comment link
    • Raw content of original comment:

      We use daemon(1) to turn Jenkins into a daemon, but it doesn't appear to support log reopening via signal. So unfortunately this is bit tricky to get right.

      I guess we should let Jenkins directly write to a log file with --logfile, since Jenkins supports log reopening via SIGALRM. Doing this requires we capture PID of the Java process, not just the daemon process.

    We use daemon(1) to turn Jenkins into a daemon, but it doesn't appear to support log reopening via signal. So unfortunately this is bit tricky to get right.

    I guess we should let Jenkins directly write to a log file with --logfile, since Jenkins supports log reopening via SIGALRM. Doing this requires we capture PID of the Java process, not just the daemon process.

  2. jenkins-infra-bot commented on Feb 4, 2011

    @jenkins-infra-bot
    Author
    markewaite:
    • Original comment link
    • Raw content of original comment:

      I thought you could avoid the hassle of closing and reopening the log by using the copytruncate setting.

      I use this configuration:

      /var/log/jenkins/jenkins.log { daily copytruncate missingok compress delaycompress notifempty rotate 8 }

    I thought you could avoid the hassle of closing and reopening the log by using the copytruncate setting.

    I use this configuration:

    /var/log/jenkins/jenkins.log
    {
    daily
    copytruncate
    missingok
    compress
    delaycompress
    notifempty
    rotate 8
    }

  3. jenkins-infra-bot commented on Apr 26, 2011

    @jenkins-infra-bot
    Author
    resmo:

    Patch is in queue #106

  4. jenkins-infra-bot commented on May 10, 2011

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Kohsuke Kawaguchi
    Path:
    debian/debian/jenkins.logrotate
    debian/debian/rules
    http://jenkins-ci.org/commit/jenkins/92aa65da2ebaeff58f4d33b8f0a067510043a20f
    Log:
    Merge pull request #109 from resmo/JENKINS-8641

    JENKINS-8641: Added a logrotate definition to the Debian/Ubuntu package.

  5. jenkins-infra-bot commented on May 10, 2011

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Kohsuke Kawaguchi
    Path:
    changelog.html
    http://jenkins-ci.org/commit/jenkins/9e69d9a95b7197a39d34c0c5f9c23c64c589f5b5
    Log:
    recording JENKINS-8641 fix

  6. jenkins-infra-bot commented on Jun 3, 2011

    @jenkins-infra-bot
    Author
    aheritier:
    • Original comment link
    • Raw content of original comment:

      fixed in changelog but issue not closed ?

    fixed in changelog but issue not closed ?

  7. jenkins-infra-bot commented on Jun 3, 2011

    @jenkins-infra-bot
    Author
    markewaite:
    • Original comment link
    • Raw content of original comment:

      New file /etc/logrotate.d/jenkins appeared in the 1.413 build.

    New file /etc/logrotate.d/jenkins appeared in the 1.413 build.

  8. jenkins-infra-bot commented on Jun 3, 2011

    @jenkins-infra-bot
    Author
    markewaite:
    • Original comment link
    • Raw content of original comment:

      Works as I had hoped. I was a little surprised that it is retaining logs for a full year (rotate 52), but that probably better fits the needs of those who retain data for longer than I retain it.

    Works as I had hoped. I was a little surprised that it is retaining logs for a full year (rotate 52), but that probably better fits the needs of those who retain data for longer than I retain it.

  9. jenkins-infra-bot commented on Sep 12, 2011

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: René Moser
    Path:
    debian/debian/jenkins.logrotate
    debian/debian/rules
    http://jenkins-ci.org/commit/jenkins/8b09a585243287b6cb5270a0a1447995f1fc3dff
    Log:
    JENKINS-8641: Added a logrotate definition to the Debian/Ubuntu package.

  10. jenkins-infra-bot commented on Sep 12, 2011

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Kohsuke Kawaguchi
    Path:
    debian/debian/jenkins.logrotate
    debian/debian/rules
    http://jenkins-ci.org/commit/jenkins/92aa65da2ebaeff58f4d33b8f0a067510043a20f
    Log:
    Merge pull request #109 from resmo/JENKINS-8641

    JENKINS-8641: Added a logrotate definition to the Debian/Ubuntu package.

  11. jenkins-infra-bot commented on Sep 12, 2011

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Kohsuke Kawaguchi
    Path:
    changelog.html
    http://jenkins-ci.org/commit/jenkins/9e69d9a95b7197a39d34c0c5f9c23c64c589f5b5
    Log:
    recording JENKINS-8641 fix

  12. jenkins-infra-bot commented on Oct 20, 2011

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: René Moser
    Path:
    debian/debian/jenkins.logrotate
    debian/debian/rules
    http://jenkins-ci.org/commit/jenkins/8b09a585243287b6cb5270a0a1447995f1fc3dff
    Log:
    JENKINS-8641: Added a logrotate definition to the Debian/Ubuntu package.

  13. jenkins-infra-bot commented on Oct 20, 2011

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Kohsuke Kawaguchi
    Path:
    debian/debian/jenkins.logrotate
    debian/debian/rules
    http://jenkins-ci.org/commit/jenkins/92aa65da2ebaeff58f4d33b8f0a067510043a20f
    Log:
    Merge pull request #109 from resmo/JENKINS-8641

    JENKINS-8641: Added a logrotate definition to the Debian/Ubuntu package.

  14. jenkins-infra-bot commented on Oct 20, 2011

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Kohsuke Kawaguchi
    Path:
    changelog.html
    http://jenkins-ci.org/commit/jenkins/9e69d9a95b7197a39d34c0c5f9c23c64c589f5b5
    Log:
    recording JENKINS-8641 fix

  15. jenkins-infra-bot commented on Apr 3, 2015

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: René Moser
    Path:
    debian/jenkins.logrotate
    debian/rules
    http://jenkins-ci.org/commit/packaging/e4cc488c7222de80bb8505e016ee5caede4300e2
    Log:
    JENKINS-8641: Added a logrotate definition to the Debian/Ubuntu package.

    Originally-From: jenkins-ci.org/commit/core/8b09a585243287b6cb5270a0a1447995f1fc3dff

  16. jenkins-infra-bot commented on Apr 3, 2015

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Kohsuke Kawaguchi
    Path:
    debian/jenkins.logrotate
    debian/rules
    http://jenkins-ci.org/commit/packaging/195bbb8c05e2ce1b96a4e3c1e45c1bc8077af4a8
    Log:
    Merge pull request #109 from resmo/JENKINS-8641

    JENKINS-8641: Added a logrotate definition to the Debian/Ubuntu package.
    Originally-From: jenkins-ci.org/commit/core/92aa65da2ebaeff58f4d33b8f0a067510043a20f

  17. jenkins-infra-bot commented on May 21, 2024

    @jenkins-infra-bot
    Author
    brianjmurrell:
    • Original comment link
    • Raw content of original comment:

      Usually logrotate needs to signal the process that it needs to use the new log file.  I.e. close and reopen so that it's using the newly created log file created by `logrotate`.  I don't see that here.

      So how does Jenkins know to stop using the rotated log and use the/a new one?

    Usually logrotate needs to signal the process that it needs to use the new log file.  I.e. close and reopen so that it's using the newly created log file created by `logrotate`.  I don't see that here.

    So how does Jenkins know to stop using the rotated log and use the/a new one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions