You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Edmondo Porcu <Ed...@gottexbrokers.com> on 2012/02/28 09:08:09 UTC

Using Log4J with an existing java.util.logging appender

Dear all,
Given an application server with his logging (based on jdk logging) I would need my application which uses log4j to log some information on the application server appender. 

Is that feasible?

Thank you very much
Best Regards


Edmondo PORCU
Associate - Financial software architect
edmondo.porcu@gottexbrokers.com
Avenue de Rhodanie 48
1007 Lausanne
Switzerland
Dir
Fax
+41 (0) 21 560 30 82
+41 (0) 21 617 71 55
The information in this email is confidential and may be legally privileged. If you are not the intended recipient, you must not read, use or disseminate the information. Although this email and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by the Gottex Group of Companies for any loss or damage arising in any way from its use.


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


AW: Using Log4J with an existing java.util.logging appender

Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
Hi Edmondo,

My understanding is that appender is a log4j concept! isn't it?

So your application (maybe an axis2 service or a different web-apps) likes to uses log4j-loggers and log4j-appenders for logging, 
then your log4j-loggers will send to one or more agreed configured log4j-appender (the destination).

As your AS does not know the appender-concept, how can it log via a log4j-logger to the attached log4j-appender? It can't!

Otherwise: Your log4j.properties mast have at least one root-logger defined which gets all what lower level log4j-loggers by use of log4j-additivity=false are not keeping by themselves, but allow to propagate to the log4j-root-logger, which is often a console. Now if this consol has the same physical device attached as the jdk-root-logger, what you will see is 1. the logging events from the AS loggers printed/formatted in a JDK way, and 2. mixed up with log records from your apps sending to a log4j-logger connected to a log4j-consol-appender.

You can stay with that MIX at the root logger level, or 
you can make your apps using JDK loggers as well, or 
you can configure your AS to make use of the log4j system.

We use the latest for flexibility, 
but even then, the AS will start with its built in logger capability 
unless it reads itself its own log4j configuration properties, when it starts to use log4j

Josef.Stadelmann@
axa-winterthur.ch


-----Ursprüngliche Nachricht-----
Von: Edmondo Porcu [mailto:Edmondo.Porcu@gottexbrokers.com] 
Gesendet: Dienstag, 28. Februar 2012 09:08
An: log4j-user@logging.apache.org
Betreff: Using Log4J with an existing java.util.logging appender

Dear all,
Given an application server with his logging (based on jdk logging) I would need my application which uses log4j to log some information on the application server appender. 

Is that feasible?

Thank you very much
Best Regards


Edmondo PORCU
Associate - Financial software architect
edmondo.porcu@gottexbrokers.com
Avenue de Rhodanie 48
1007 Lausanne
Switzerland
Dir
Fax
+41 (0) 21 560 30 82
+41 (0) 21 617 71 55
The information in this email is confidential and may be legally privileged. If you are not the intended recipient, you must not read, use or disseminate the information. Although this email and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by the Gottex Group of Companies for any loss or damage arising in any way from its use.


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


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


Re: Using Log4J with an existing java.util.logging appender

Posted by Douglas E Wegscheid <Do...@whirlpool.com>.
I'm not sure this will work, but may be worth exploring: use the slf4j 
log4j adapter (so calls to log4j logging calls go to slf4j), and configure 
slf4j to log to j.u.l.


â–  DOUGLAS E. WEGSCHEID // LEAD ENGINEER
(269) 923-5278 // Douglas_E_Wegscheid@whirlpool.com
"A wrong note played hesitatingly is a wrong note. A wrong note played 
with conviction is interpretation."



Edmondo Porcu <Ed...@gottexbrokers.com> 
02/28/2012 03:08 AM
Please respond to
"Log4J Users List" <lo...@logging.apache.org>


To
"log4j-user@logging.apache.org" <lo...@logging.apache.org>
cc

Subject
Using Log4J with an existing java.util.logging appender






Dear all,
Given an application server with his logging (based on jdk logging) I 
would need my application which uses log4j to log some information on the 
application server appender. 

Is that feasible?

Thank you very much
Best Regards


Edmondo PORCU
Associate - Financial software architect
edmondo.porcu@gottexbrokers.com
Avenue de Rhodanie 48
1007 Lausanne
Switzerland
Dir
Fax
+41 (0) 21 560 30 82
+41 (0) 21 617 71 55
The information in this email is confidential and may be legally 
privileged. If you are not the intended recipient, you must not read, use 
or disseminate the information. Although this email and any attachments 
are believed to be free of any virus or other defect that might affect any 
computer system into which it is received and opened, it is the 
responsibility of the recipient to ensure that it is virus free and no 
responsibility is accepted by the Gottex Group of Companies for any loss 
or damage arising in any way from its use.


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