[logback-dev] [JIRA] Commented: (LBCLASSIC-176) Asynchronous File appender

Konstantin Alexandrov (JIRA) noreply-jira at qos.ch
Mon Dec 21 22:09:33 CET 2009


    [ http://jira.qos.ch/browse/LBCLASSIC-176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11472#action_11472 ] 

Konstantin Alexandrov commented on LBCLASSIC-176:
-------------------------------------------------

Ralph, you are right.

Asynch or Buffered or Deffered processing match more important for rolling appender, because rolling of logfile may takes lot of time, we can talk about seconds
in the case of big file (100m - why not) and compression.  Thread pool - i'm not sure this is good idea. You will need to synchronize file writing, so no gain, just increase context switching.

prepareForDeferredProcessing: I can not see any problem to add new Throwable(), for now - yes, will not work

just add private/protected method to LoggingEvent

private Throwable t = null
getCallerThrowable(){
  if (t==null) t = new Throwable();
  return t;
}

Use this method instead of new Throwable() and call this method in prepareFordeferredProcessing()

Pooling objects - yes, exactly, you right for flexible common usage appender. But this is responsibility of caller. 
Am I right conversion of content of argumentArray to string array can solve it in prepareFordeferredProcessing?
...
 for (int i=0;i<argumentArray.length;i++)  argumentArray[i] = argumentArray[i].toString();
...

Okay, I think it's better to make behaviour configurable.
I'm not so experienced in logback source code, so I will need time to implement configurable parameters. 
I think some parameters should be set in configuration file:
 - writer thread 
 - max pending (deffered) events
 - differed serialization (true/false) 
 - skip events level when max pending events reached


p.s.
Sorry for my English.

> Asynchronous File appender
> --------------------------
>
>                 Key: LBCLASSIC-176
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-176
>             Project: logback-classic
>          Issue Type: New Feature
>          Components: appender
>            Reporter: Konstantin Alexandrov
>            Assignee: Logback dev list
>         Attachments: asynch.zip, AsynchRollingFileAppender.java, AsynchRollingFileAppender.java
>
>
> I implement asynch rolling file appender for my application, the reason is to decrease logging time in time critical part of application.
> This logger save up to 2 time logging time and decrease total IO concurrency. If you found this appender usable, then please include
> to distribution.
> Thanks

-- 
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

        


More information about the logback-dev mailing list