Howto : Jenkins executable WAR and rotating log files

601 views
Skip to first unread message

hanasaki-jenkins

unread,
Feb 26, 2014, 1:13:16 AM2/26/14
to jenkins...@googlegroups.com
Q: How can the Jenkins self executable be configured to rotate log files automatically?
It is running from a linux bash script with the "-logfile=" option as in the below referenced link.

Q: Why is the line half covered in a "strike through"? (below referenced link)

reference: https://wiki.jenkins-ci.org/display/JENKINS/Starting+and+Accessing+Jenkins

James Nord (jnord)

unread,
Feb 26, 2014, 2:20:15 AM2/26/14
to jenkins...@googlegroups.com

For log rotation you have a few options

 

Option 1

Use logrotoate.

 

[foo@host ~]# cat /etc/logrotate.d/jenkins

/opt/jenkins/logs/jenkins.log /opt/jenkins/logs/access_log {

    compress

    dateext

    maxage 365

    rotate 99

    size=+4096k

    notifempty

    missingok

    create 644

    postrotate

        if [ -s /var/run/jenkins.pid ]; then

            JPID=`cat /var/run/jenkins.pid`

            test -n "`find /proc/$JPID -maxdepth 0 -user jenkins 2>/dev/null`" && kill -s ALRM $JPID || :

        fi

    endscript

}

 

Option 2

onfigure java logging (pass -Djava.util.logging.config.file=/opt/jenkins/logging.properties to the JVM) and specify the configurationtion and implementation to do rollover/deletion.

 

 

For your second question – confluence has markedup the double dash -- as a strikethrough command (and it should be makred as nomarkup in the wiki).

 

/James

 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages