[JIRA] Created: (LBCORE-90) RollingFileAppender calls triggeringPolicy.isTriggeringEvent(activeFile, event) with the same activeFile

RollingFileAppender calls triggeringPolicy.isTriggeringEvent(activeFile, event) with the same activeFile -------------------------------------------------------------------------------------------------------- Key: LBCORE-90 URL: http://jira.qos.ch/browse/LBCORE-90 Project: logback-core Issue Type: Bug Components: Appender Affects Versions: 0.9.14 Reporter: Valery Shorin Assignee: Logback dev list In subAppend(...) method RollingFileAppender calls triggeringPolicy.isTriggeringEvent(activeFile, event) method with activeFileCache variable as first parameter, but activeFileCache variable initialized in start() method of RollingFileAppender and not changed anymore. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-90?page=com.atlassian.jira.plugin.system.is... ] Valery Shorin commented on LBCORE-90: ------------------------------------- I'm trying to create custom triggering policy, active file name in this policy changed every rollover event, one condition of rollover based on active file size. I tried to use activeFile passed to isTriggeringEvent(...) method, but it's always the same.
RollingFileAppender calls triggeringPolicy.isTriggeringEvent(activeFile, event) with the same activeFile --------------------------------------------------------------------------------------------------------
Key: LBCORE-90 URL: http://jira.qos.ch/browse/LBCORE-90 Project: logback-core Issue Type: Bug Components: Appender Affects Versions: 0.9.14 Reporter: Valery Shorin Assignee: Ceki Gulcu
In subAppend(...) method RollingFileAppender calls triggeringPolicy.isTriggeringEvent(activeFile, event) method with activeFileCache variable as first parameter, but activeFileCache variable initialized in start() method of RollingFileAppender and not changed anymore.
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-90?page=com.atlassian.jira.plugin.system.is... ] Ceki Gulcu commented on LBCORE-90: ---------------------------------- Hello Valery, Thank you for this report. In addition to size, what are your other conditions for rollover?
RollingFileAppender calls triggeringPolicy.isTriggeringEvent(activeFile, event) with the same activeFile --------------------------------------------------------------------------------------------------------
Key: LBCORE-90 URL: http://jira.qos.ch/browse/LBCORE-90 Project: logback-core Issue Type: Bug Components: Appender Affects Versions: 0.9.14 Reporter: Valery Shorin Assignee: Ceki Gulcu
In subAppend(...) method RollingFileAppender calls triggeringPolicy.isTriggeringEvent(activeFile, event) method with activeFileCache variable as first parameter, but activeFileCache variable initialized in start() method of RollingFileAppender and not changed anymore.
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-90?page=com.atlassian.jira.plugin.system.is... ] Valery Shorin commented on LBCORE-90: ------------------------------------- Hi Ceki, Conditions of rollover are: if log file size>maxFileSize || once per day || event.getMarker() contains "rotate" marker. It's my isTriggeringEvent() method (previous version) @Override public boolean isTriggeringEvent(File activeFile, LoggingEvent event) { Marker marker = event.getMarker(); // activeFile should be checked here, but RollingFileAppender always // calls this method with the same activeFile File active = new File(getActiveFileName()); if (active.length() > maxFileSize || System.currentTimeMillis() > lastCheck + period || marker != null && marker.contains(LogConstants.rotateMarker)) { lastElapsedCheck = lastCheck; lastCheck = System.currentTimeMillis(); return true; } return false; } But "File active = new File(getActiveFileName()); if (active.length() > maxFileSize" construction is performance bootleneck, and this method is changed as follows: @Override public boolean isTriggeringEvent(File activeFile, LoggingEvent event) { Marker marker = event.getMarker(); if (bytesWritten > maxFileSize || System.currentTimeMillis() > lastCheck + period || marker != null && marker.contains(LogConstants.rotateMarker)) { lastElapsedCheck = lastCheck; bytesWritten = 0; lastCheck = System.currentTimeMillis(); return true; } return false; } Where "bytesWritten" field is changed from Layout.doLayout(..) method: public String doLayout(LoggingEvent event) { ................................ parent.getRollingPolicy().bytesWritten(result.length()); return result; } It's not convenient, but we have access to logged string only here. So, my thoughts regarding this bug: 1. I think "activeFile" parameter is unnecessary, we can obtain it using getActiveFileName() method. 2. It will be great if more convenient way to obtain information how many bytes are written to active file will be provided. Thanks, Valery
RollingFileAppender calls triggeringPolicy.isTriggeringEvent(activeFile, event) with the same activeFile --------------------------------------------------------------------------------------------------------
Key: LBCORE-90 URL: http://jira.qos.ch/browse/LBCORE-90 Project: logback-core Issue Type: Bug Components: Appender Affects Versions: 0.9.14 Reporter: Valery Shorin Assignee: Ceki Gulcu
In subAppend(...) method RollingFileAppender calls triggeringPolicy.isTriggeringEvent(activeFile, event) method with activeFileCache variable as first parameter, but activeFileCache variable initialized in start() method of RollingFileAppender and not changed anymore.
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-90?page=com.atlassian.jira.plugin.system.is... ] Ceki Gulcu resolved LBCORE-90. ------------------------------ Fix Version/s: 0.9.17 Resolution: Fixed Hello Valery, This issue was solved in a recent commit. Have a look at SizeAndTimeBasedFNATP which I believe does size and time-based rolling as you requested and more.
RollingFileAppender calls triggeringPolicy.isTriggeringEvent(activeFile, event) with the same activeFile --------------------------------------------------------------------------------------------------------
Key: LBCORE-90 URL: http://jira.qos.ch/browse/LBCORE-90 Project: logback-core Issue Type: Bug Components: Appender Affects Versions: 0.9.14 Reporter: Valery Shorin Assignee: Ceki Gulcu Fix For: 0.9.17
In subAppend(...) method RollingFileAppender calls triggeringPolicy.isTriggeringEvent(activeFile, event) method with activeFileCache variable as first parameter, but activeFileCache variable initialized in start() method of RollingFileAppender and not changed anymore.
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-90?page=com.atlassian.jira.plugin.system.is... ] Ceki Gulcu edited comment on LBCORE-90 at 8/7/09 10:37 PM: ----------------------------------------------------------- Hello Valery, This issue was solved in a recent commit. Have a look at SizeAndTimeBasedFNATP which I believe does size and time-based rolling as you requested and more. The file size lookup can be a mitigated by doing the check every 16 calls. was (Author: noreply.ceki@qos.ch): Hello Valery, This issue was solved in a recent commit. Have a look at SizeAndTimeBasedFNATP which I believe does size and time-based rolling as you requested and more.
RollingFileAppender calls triggeringPolicy.isTriggeringEvent(activeFile, event) with the same activeFile --------------------------------------------------------------------------------------------------------
Key: LBCORE-90 URL: http://jira.qos.ch/browse/LBCORE-90 Project: logback-core Issue Type: Bug Components: Appender Affects Versions: 0.9.14 Reporter: Valery Shorin Assignee: Ceki Gulcu Fix For: 0.9.17
In subAppend(...) method RollingFileAppender calls triggeringPolicy.isTriggeringEvent(activeFile, event) method with activeFileCache variable as first parameter, but activeFileCache variable initialized in start() method of RollingFileAppender and not changed anymore.
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-90?page=com.atlassian.jira.plugin.system.is... ] Ceki Gulcu commented on LBCORE-90: ---------------------------------- By the way, after looking at SizeAndTimeBasedFNATP, if you still wish to have access to the number of bytes written in a given file, I propose that you create a new bug report.
RollingFileAppender calls triggeringPolicy.isTriggeringEvent(activeFile, event) with the same activeFile --------------------------------------------------------------------------------------------------------
Key: LBCORE-90 URL: http://jira.qos.ch/browse/LBCORE-90 Project: logback-core Issue Type: Bug Components: Appender Affects Versions: 0.9.14 Reporter: Valery Shorin Assignee: Ceki Gulcu Fix For: 0.9.17
In subAppend(...) method RollingFileAppender calls triggeringPolicy.isTriggeringEvent(activeFile, event) method with activeFileCache variable as first parameter, but activeFileCache variable initialized in start() method of RollingFileAppender and not changed anymore.
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
participants (2)
-
Ceki Gulcu (JIRA)
-
Valery Shorin (JIRA)