You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2008/06/09 09:32:14 UTC

DO NOT REPLY [Bug 45165] New: Multifile Appender

https://issues.apache.org/bugzilla/show_bug.cgi?id=45165

           Summary: Multifile Appender
           Product: Log4j
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Appender
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: haeberling@privasphere.com
                CC: carnold@apache.org


Created an attachment (id=22098)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22098)
MultiFileAppender implementation

The multifile sandbox project
(http://svn.apache.org/repos/asf/logging/sandbox/log4j/multifile) is currently
in an unusable state.

The goal of this Bug is to get a working implementation of the Multifile
Appender.

I attach a basic implementation of the MultiFileAppender.
It uses a SubAppender class which inherits from FileAppender and encapsulates
the File handling stuff.
The append method manages the open files and delegates the log events to the
SubAppenders.

There is a simple test case, that instantiates some threads, that log
simultaneously.

Any comments are welcome


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45165] Multifile Appender

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45165

--- Comment #7 from Ralf Hauser <ha...@acm.org> 2009-10-01 04:44:27 PDT ---
see also http://marc.info/?l=log4j-user&m=121252695203831&w=2

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45165] Multifile Appender

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45165





--- Comment #5 from Ralf Hauser <ha...@acm.org>  2008-09-07 22:49:47 PST ---
re comment 4 
I guess Thread.local won't work, so probably such threads need to be made
multifile-appender aware (which I don't mind)
I guess they'll have to implement an additional abstract interface with a local
variable that allows to tell the multifile appender which was the parent's
appender


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45165] Multifile Appender

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45165





--- Comment #4 from Ralf Hauser <ha...@acm.org>  2008-09-07 22:29:19 PST ---
just noticed in a tomcat setting where one thread goes into say appender A1, if
that thread spawns a sub-thread, its ouput is not visibly in A1, but again in
catalina.out as the "catch-all"...


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45165] Multifile Appender

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45165





--- Comment #6 from senthilkumar <tk...@gmail.com>  2009-01-14 03:41:41 PST ---
Hi ,

Thanks for sharing new Developement Actually its a new requirement for me and i
got it here .its fit my requirement.Can u please tell how to set the Same using
log4j.properties.

i tried the below one but it giving error.
log4j:ERROR No defaultFileName set for the appender named [fcrjlog].



log4j.rootLogger=DEBUG, fcrjlog

log4j.appender.fcrjlog=org.apache.log4j.multifile.MultiFileAppender
log4j.appender.fcrjlog.File=D:\\Flexcube\\host\\logs\\fcrjlog.txt
log4j.appender.fcrjlog.layout=org.apache.log4j.PatternLayout
log4j.appender.fcrjlog.layout.ConversionPattern=%d %t %p [%c] %m%n


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45165] Multifile Appender

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45165





--- Comment #3 from Curt Arnold <ca...@apache.org>  2008-06-13 15:20:25 PST ---
Will probably make some of the extension points "private" until internals
settle down.  Was intending to use java.nio and would likely move formatting
and encoding up to the Appender itself.  Might make MFA a specialization of a
MultiChannelAppender.

Definitely will need more unit tests.

Thanks for the contribution.  Will use this bug report for continued discussion
on this feature.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45165] Multifile Appender

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45165


Ralf Hauser <ha...@acm.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hauser@acm.org




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45165] Multifile Appender

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45165





--- Comment #1 from Armin Häberling <ha...@privasphere.com>  2008-06-10 06:29:10 PST ---
Created an attachment (id=22104)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22104)
MultiFileAppender.java - new version

A new version of the MultiFileAppender class.

The old one had a NullPointerException if a file could not be opened.
I fixed that and also did some refactoring: I removed the dependency on the
FileAppender. This makes the code is much clearer and the error handling
easier.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45165] Multifile Appender

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45165


Curt Arnold <ca...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




--- Comment #2 from Curt Arnold <ca...@apache.org>  2008-06-13 12:46:49 PST ---
Attachment 22104 committed in rev 667628.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org