[logback-dev] [JIRA] Commented: (LBCLASSIC-176) Asynchronous File appender
Ralph Goers (JIRA)
noreply-jira at qos.ch
Mon Dec 21 16:43:33 CET 2009
[ http://jira.qos.ch/browse/LBCLASSIC-176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11471#action_11471 ]
Ralph Goers commented on LBCLASSIC-176:
---------------------------------------
I have a couple comments. First, with regard to Konstantin's comments.
"Difference between your and mine appender is I use only one thread to write logs, your thread per appender. "
That is one difference. I consider the major difference to be that yours only supports the RollingFileAppender. I'm attempting to make any Appender asynchronous. Actually, with regards to the threads I think the right way to do this is to use a pool of threads.
"// this is heavy thing, will be done in caller thread context. Rather than prepare this, it's bettrer to just create Throwable object in prepareForDeferredProcessing, and use prepared object in getCallerData".
Yes, that would make sense except that prepareForDefferedProcessing currently doesn't do it so this code needs to. In addition, there is also nowhere to attach the new Throwable in the logging event and there is no method that would make use of it. However, whether or not to get callerData could be configurable.
"//if prepared, then reason of asynchronous handling is loosed, in this case we have only asynch writing "
There have been discussions that when Objects are passed as arguments that they are not necessarily static. Passing them to the worker thread may result in strange messages or odd behavior as the Objects may no longer be valid. For example, the application might be using a pool of objects to do some work and pass the current object on the logging call. By the time the worker thread processes it it could be in use for some other purpose. This problem cannot occur if the message is formatted on the same thread.
As for Cekit's suggestions, yes they will make the code more complicated but they make sense to do. To be of value this Appender needs to be fairly flexible.
I'm interested in doing the work, time permitting.
> 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