[JIRA] [audit-trail-plugin] (JENKINS-28288) Audit Trail Plugin log file issues

128 views
Skip to first unread message

mark.nejman@trexcorporation.com (JIRA)

unread,
May 7, 2015, 11:28:01 AM5/7/15
to jenkinsc...@googlegroups.com
Mark Nejman created an issue
 
Jenkins / Bug JENKINS-28288
Audit Trail Plugin log file issues
Issue Type: Bug Bug
Assignee: Unassigned
Components: audit-trail-plugin
Created: 07/May/15 3:27 PM
Environment: Jenkins 1.611 running on RHEL 6.6 using audit-trail plugin 2.1
Labels: logging
Priority: Major Major
Reporter: Mark Nejman

There are multiple issues with the Log File logger in the audit-trail plugin.

The first has to do with log file rotation. I set the count parameter to 1 and the limit to 5000000000. Yet the log file is still being rotated every time more than two lines are written:

[jenkins ~]$ cat /data/jenkins/audit-trail.xml 
<?xml version='1.0' encoding='UTF-8'?>
<hudson.plugins.audit__trail.AuditTrailPlugin plugin="audit-trail@2.1">
  <pattern>.*/(?:configSubmit|doDelete|postBuildResult|cancelQueue|stop|toggleLogKeep|doWipeOutWorkspace|createItem|createView|toggleOffline)</pattern>
  <logBuildCause>true</logBuildCause>
  <loggers>
    <hudson.plugins.audit__trail.LogFileAuditLogger>
      <log>/data/jenkins/logs/audit-trail.log</log>
      <limit>500000000</limit>
      <count>1</count>
    </hudson.plugins.audit__trail.LogFileAuditLogger>
  </loggers>
</hudson.plugins.audit__trail.AuditTrailPlugin>

[jenkins ~]$ ls -altr /data/jenkins/logs/audit-trail.log*
-rw-r--r--. 1 jenkins jenkins   0 May  7 11:05 /data/jenkins/logs/audit-trail.log.lck
-rw-r--r--. 1 jenkins jenkins  97 May  7 11:06 /data/jenkins/logs/audit-trail.log
-rw-r--r--. 1 jenkins jenkins   0 May  7 11:06 /data/jenkins/logs/audit-trail.log.1.lck
-rw-r--r--. 1 jenkins jenkins  97 May  7 11:06 /data/jenkins/logs/audit-trail.log.1
-rw-r--r--. 1 jenkins jenkins   0 May  7 11:06 /data/jenkins/logs/audit-trail.log.2.lck
-rw-r--r--. 1 jenkins jenkins  97 May  7 11:06 /data/jenkins/logs/audit-trail.log.2
-rw-r--r--. 1 jenkins jenkins   0 May  7 11:07 /data/jenkins/logs/audit-trail.log.3.lck
-rw-r--r--. 1 jenkins jenkins  97 May  7 11:14 /data/jenkins/logs/audit-trail.log.3
-rw-r--r--. 1 jenkins jenkins   0 May  7 11:14 /data/jenkins/logs/audit-trail.log.4.lck
-rw-r--r--. 1 jenkins jenkins 115 May  7 11:15 /data/jenkins/logs/audit-trail.log.4
-rw-r--r--. 1 jenkins jenkins   0 May  7 11:15 /data/jenkins/logs/audit-trail.log.5.lck
-rw-r--r--. 1 jenkins jenkins 115 May  7 11:15 /data/jenkins/logs/audit-trail.log.5
-rw-r--r--. 1 jenkins jenkins   0 May  7 11:15 /data/jenkins/logs/audit-trail.log.6.lck
-rw-r--r--. 1 jenkins jenkins   0 May  7 11:15 /data/jenkins/logs/audit-trail.log.6

The next issue has to do with the limit parameter. In the Jenkins console configuration screen, it says says "Log File Size MB" whereas the JavaDoc for FileHandler says the limit parameter is "the maximum number of bytes to write to any one file". As mentioned above, I used a limit of 500000000 assuming it is actually using bytes. However since the rotation isn't working correctly, I have no way of verifying whether or not the plugin does a conversion from MB to bytes.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

mark.nejman@trexcorporation.com (JIRA)

unread,
May 7, 2015, 11:34:01 AM5/7/15
to jenkinsc...@googlegroups.com
Mark Nejman updated an issue
Change By: Mark Nejman
There are multiple issues with the Log File logger in the audit-trail plugin.

The first has to do with log file rotation.  I set the count parameter to 1 and the limit to  5000000000  500000000 .  Yet the log file is still being rotated every time more than two lines are written:

{code}
{code}


The next issue has to do with the limit parameter.  In the Jenkins console configuration screen, it says says "Log File Size MB" whereas the JavaDoc for FileHandler says the limit parameter is "the maximum number of bytes to write to any one file".  As mentioned above, I used a limit of 500000000 assuming it is actually using bytes.  However since the rotation isn't working correctly, I have no way of verifying whether or not the plugin does a conversion from MB to bytes.


I should note that I also did try limit values of 512 and 1024, but still am seeing the logs rotate after two lines are written.

mark.nejman@trexcorporation.com (JIRA)

unread,
May 7, 2015, 12:23:02 PM5/7/15
to jenkinsc...@googlegroups.com
Mark Nejman updated an issue
Audit Trail Plugin log file rotation issue
Change By: Mark Nejman
Summary: Audit Trail Plugin log file  issues  rotation issue
There  are multiple issues  is a log rotation issue  with the Log File logger in the audit-trail plugin.

The first has to do with log file rotation.   I set the count parameter to 1 and the limit to  500000000  512 .  Yet the log file is still being rotated every time more than two lines are written:


{code}
[jenkins ~]$ cat /data/jenkins/audit-trail.xml 
<?xml version='1.0' encoding='UTF-8'?>
<hudson.plugins.audit__trail.AuditTrailPlugin plugin="audit-trail@2.1">
  <pattern>.*/(?:configSubmit|doDelete|postBuildResult|cancelQueue|stop|toggleLogKeep|doWipeOutWorkspace|createItem|createView|toggleOffline)</pattern>
  <logBuildCause>true</logBuildCause>
  <loggers>
    <hudson.plugins.audit__trail.LogFileAuditLogger>
      <log>/data/jenkins/logs/audit-trail.log</log>
      <limit> 500000000 512 </limit>

      <count>1</count>
    </hudson.plugins.audit__trail.LogFileAuditLogger>
  </loggers>
</hudson.plugins.audit__trail.AuditTrailPlugin>

[jenkins ~]$ ls -altr /data/jenkins/logs/audit-trail.log*
-rw-r--r--. 1 jenkins jenkins   0 May  7 11:05 /data/jenkins/logs/audit-trail.log.lck
-rw-r--r--. 1 jenkins jenkins  97 May  7 11:06 /data/jenkins/logs/audit-trail.log
-rw-r--r--. 1 jenkins jenkins   0 May  7 11:06 /data/jenkins/logs/audit-trail.log.1.lck
-rw-r--r--. 1 jenkins jenkins  97 May  7 11:06 /data/jenkins/logs/audit-trail.log.1
-rw-r--r--. 1 jenkins jenkins   0 May  7 11:06 /data/jenkins/logs/audit-trail.log.2.lck
-rw-r--r--. 1 jenkins jenkins  97 May  7 11:06 /data/jenkins/logs/audit-trail.log.2
-rw-r--r--. 1 jenkins jenkins   0 May  7 11:07 /data/jenkins/logs/audit-trail.log.3.lck
-rw-r--r--. 1 jenkins jenkins  97 May  7 11:14 /data/jenkins/logs/audit-trail.log.3
-rw-r--r--. 1 jenkins jenkins   0 May  7 11:14 /data/jenkins/logs/audit-trail.log.4.lck
-rw-r--r--. 1 jenkins jenkins 115 May  7 11:15 /data/jenkins/logs/audit-trail.log.4
-rw-r--r--. 1 jenkins jenkins   0 May  7 11:15 /data/jenkins/logs/audit-trail.log.5.lck
-rw-r--r--. 1 jenkins jenkins 115 May  7 11:15 /data/jenkins/logs/audit-trail.log.5
-rw-r--r--. 1 jenkins jenkins   0 May  7 11:15 /data/jenkins/logs/audit-trail.log.6.lck
-rw-r--r--. 1 jenkins jenkins   0 May  7 11:15 /data/jenkins/logs/audit-trail.log.6
{code}

The next issue has to do with It appears  the  limit parameter.  In the Jenkins console configuration screen, it says says "Log File Size MB" whereas the JavaDoc for FileHandler says the limit parameter is "the maximum number of bytes to write to any one file".  As mentioned above, I used a limit of 500000000 assuming it is actually using bytes.  However since the  log  rotation  isn't  count is not  working correctly , I have no way of verifying whether or not the plugin does a conversion from MB to bytes .

I should note that I also did try limit values of 512 and 1024, but still am seeing the logs rotate after two lines are written.

mark.nejman@trexcorporation.com (JIRA)

unread,
May 7, 2015, 1:10:01 PM5/7/15
to jenkinsc...@googlegroups.com
Mark Nejman commented on Bug JENKINS-28288
 
Re: Audit Trail Plugin log file rotation issue

I see there are multiple .lck files that are opened and do not go away. From reading up on FileHandler, that typically indicates multiple instances of FileHandler being instantiated. They say that is typically caused by multiple JVMs writing to the same log file. However, I am only using one JVM (verified with ps).

I'm wondering if the issue is in hudson.plugins.audit_trail.LogFileAuditLogger line 21:

private transient FileHandler handler;

I'm thinkning maybe the extension creates several instances of the audit-trail logger, and therefore multiple FileHandler instances trying to write to the same log file.

Is there a reason this attribute is marked as transient? I didn't think this was a serializable object. Perhaps the solution would be to mark it as static so that multiple instances do not exist in the same container.

mark.nejman@trexcorporation.com (JIRA)

unread,
May 7, 2015, 1:11:01 PM5/7/15
to jenkinsc...@googlegroups.com
Mark Nejman assigned an issue to Nicolas De Loof
 
Change By: Mark Nejman
Assignee: Nicolas De Loof

mark.nejman@trexcorporation.com (JIRA)

unread,
May 18, 2015, 1:21:01 PM5/18/15
to jenkinsc...@googlegroups.com
Mark Nejman assigned an issue to Unassigned

pibeitz@gmail.com (JIRA)

unread,
May 19, 2019, 9:59:02 AM5/19/19
to jenkinsc...@googlegroups.com
Pierre Beitz resolved as Fixed
Change By: Pierre Beitz
Status: Open Resolved
Assignee: Pierre Beitz
Resolution: Fixed
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

pibeitz@gmail.com (JIRA)

unread,
May 19, 2019, 9:59:02 AM5/19/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages