Re: AW: Re: log4j

"Guillaume Sauthier (OW2)" <[email protected]> Fri, 20 Jan 2012 09:44:08 +0100
Newsgroups gmane.comp.java.objectweb.jonas
Message-ID <CAG1yf3MPX83KNe9V-TPC-=EvEiVn7tW+75G6uUhWVrgBp=0eqA@mail.gmail.com>
--bcaec554d9082a3c5704b6f1af90
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Monolog is mostly for the application server logging.
By default, it's relying on the JDK's logging system.
The property you want to change is used to replace that underlying logging
system with another one, BUT still using the same configuration file
(trace.properties).
Is that what you want to do ?

If you simply want to use log4j for your application, I suggest to simply
put your log4j.jar inside your app (lib/ if is an Ear or WEB-INF/lib/ if is
a Webapp). I also advise you to init your Log4j by hand using a
ServletContextListener.
Here are some examples:
http://www.javatastic.com/2007/08/22/initialize-log4j-in-a-web-application/
(watch
the config file)
http://blog.idleworx.com/2010/01/setting-up-log4j-for-simple-java-web.html
(read
1 time the log4j configuration)

Thanks
--G

2012/1/19 Schuch, Mathias (Mathias) <[email protected]>

> My JOnAS version is 5.1.5.****
>
> ** **
>
> Regards Mathias****
>
> ** **
>
> *with  **J**  regards** **
> **mit  **J** Gr=FC=DFen ***
>
> <http://www.avaya.de/>
> Mathias Schuch | Unified Server Applications |
> Avaya GmbH & Co KG | Kleyerstra=DFe 94 | 60326 Frankfurt |
> Voice: +49 69 7505 6064 | Fax:  +49 69 7505 56064 |
> Email: [email protected] ****
>
> Sitz der Gesellschaft: Frankfurt/Main
> Registergericht: Amtsgericht Frankfurt/Main - HRA 29419
> Pers. haftender Gesellschafter: Avaya Verwaltungs GmbH in Frankfurt/Main
> Registergericht: Amtsgericht Frankfurt/Main - HRB 76816
> Gesch=E4ftsf=FChrer: Markus Ernesti, Dr. Wolfgang Runge, Wolfgang Zorn
>
> Erreichen Sie den richtigen Avaya Ansprechpartner mit kostenfreien
> Rufnummern:
> Tel: 0800-GOAVAYA =3D 0800 46 28 29 2 | Fax: 0800-AVAYAFAX =3D 0800 28 29=
 23
> 29
>
> Ihr direkter Zugang zu unserem Kundenportal MeinAvaya: www.meinavaya.de
>
> <http://twitter.com/#!/Avaya_D> <http://www.facebook.com/AvayaDeutschland=
><http://www.youtube.com/AvayaDeutschland><http://www.xing.com/companies/av=
aya><http://www.linkedin.com/companies/1494?trk=3DNUS_CMPY_FOL-co><http://w=
ww.flickr.com/photos/avaya><http://www.avaya.com/blogs>
>
> <http://www.meinavaya.de>[ Bitte denken Sie =FCber Ihre Verantwortung
> gegen=FCber der Umwelt nach, bevor Sie diese E-Mail ausdrucken! ]****
>
> ** **
>
> *Von:* [email protected] [mailto:[email protected]] *Im
> Auftrag von *Guillaume Sauthier (OW2)
> *Gesendet:* Donnerstag, 19. Januar 2012 12:03
> *An:* [email protected]
> *Betreff:* [jonas] Re: log4j****
>
> ** **
>
> What is your version of JOnAS ?****
>
> --G****
>
> 2012/1/17 <[email protected]>****
>
> Hi,
>
> i want to use log4j with JOnAS. I follow the configuration guide and putt
> the
> log4j.properties in $JONAS_BASE/conf and log4j jar file in
> $JONAS_BASE/lib/commons.
> If I now uncomment in trace.properties the wrapper:
> "log.config.classname
> org.objectweb.util.monolog.wrapper.log4j.MonologLoggerFactory"
> and comment the wrapper:
> "log.config.classname
> org.objectweb.util.monolog.wrapper.javaLog.LoggerFactory"
> I get the following execption:
> "Cannot get LoggerFactory:java.lang.ClassNotFoundException:
> org.objectweb.util.monolog.wrapper.log4j.MonologLoggerFactory"
>
> What am I doing wrong?
>
> Thanks
> Mathias****
>
> ** **
>

--bcaec554d9082a3c5704b6f1af90
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Monolog is mostly for the application server logging.<div>By default, it&#3=
9;s relying on the JDK&#39;s logging system.</div><div>The property you wan=
t to change is used to replace that underlying logging system with another =
one, BUT still using the same configuration file (trace.properties).</div>

<div>Is that what you want to do ?</div><div><br><div>If you simply want to=
 use log4j for your application, I suggest to simply put your log4j.jar ins=
ide your app (lib/ if is an Ear or WEB-INF/lib/ if is a Webapp). I also adv=
ise you to init your Log4j by hand using a ServletContextListener.</div>
<div>Here are some examples:</div><div><a href=3D"http://www.javatastic.com=
/2007/08/22/initialize-log4j-in-a-web-application/">http://www.javatastic.c=
om/2007/08/22/initialize-log4j-in-a-web-application/</a>=A0(watch the confi=
g file)</div>
<div><a href=3D"http://blog.idleworx.com/2010/01/setting-up-log4j-for-simpl=
e-java-web.html">http://blog.idleworx.com/2010/01/setting-up-log4j-for-simp=
le-java-web.html</a>=A0(read 1 time the log4j configuration)<br>
<br>Thanks</div><div>--G<br><br><div class=3D"gmail_quote">2012/1/19 Schuch=
, Mathias (Mathias) <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]=
om" target=3D"_blank">[email protected]</a>&gt;</span><br><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex">


<div lang=3D"DE" link=3D"blue" vlink=3D"purple"><div><p class=3D"MsoNormal"=
><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-family:&quot;Arial&quo=
t;,&quot;sans-serif&quot;;color:#1f497d">My JOnAS version is 5.1.5.<u></u><=
u></u></span></p>

<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-=
family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u>=A0<u=
></u></span></p><p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-s=
ize:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f49=
7d">Regards Mathias<u></u><u></u></span></p>

<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-=
family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u>=A0<u=
></u></span></p><div><p class=3D"MsoNormal"><b><i><span style=3D"font-size:=
10.0pt;font-family:&quot;Lucida Sans Unicode&quot;,&quot;sans-serif&quot;;c=
olor:blue">with=A0 </span></i></b><b><i><span style=3D"font-size:10.0pt;fon=
t-family:Wingdings;color:blue">J</span></i></b><b><i><span style=3D"font-si=
ze:10.0pt;font-family:&quot;Lucida Sans Unicode&quot;,&quot;sans-serif&quot=
;;color:blue">=A0 regards</span></i></b><b><i><span style=3D"font-size:10.0=
pt;font-family:&quot;Lucida Sans Unicode&quot;,&quot;sans-serif&quot;"> </s=
pan></i></b><b><i><span style=3D"font-size:10.0pt;font-family:&quot;Lucida =
Sans Unicode&quot;,&quot;sans-serif&quot;;color:blue"><br>

</span></i></b><b><i><span style=3D"font-size:10.0pt;font-family:&quot;Luci=
da Sans Unicode&quot;,&quot;sans-serif&quot;;color:blue">mit=A0 </span></i>=
</b><b><i><span style=3D"font-size:10.0pt;font-family:Wingdings;color:blue"=
>J</span></i></b><b><i><span style=3D"font-size:10.0pt;font-family:&quot;Lu=
cida Sans Unicode&quot;,&quot;sans-serif&quot;;color:blue"> Gr=FC=DFen </sp=
an></i></b><b><i><span style=3D"font-size:10.0pt;font-family:&quot;Lucida S=
ans Unicode&quot;,&quot;sans-serif&quot;;color:blue"><u></u><u></u></span><=
/i></b></p>

<p class=3D"MsoNormal"><a href=3D"http://www.avaya.de/" target=3D"_blank"><=
span style=3D"font-size:10.0pt;font-family:&quot;Century Gothic&quot;,&quot=
;sans-serif&quot;;text-decoration:none"><img border=3D"0" width=3D"495" hei=
ght=3D"58"></span></a><span style=3D"font-size:10.0pt;font-family:&quot;Cen=
tury Gothic&quot;,&quot;sans-serif&quot;;color:#1f497d"><br>

</span><span style=3D"font-size:10.0pt;font-family:&quot;Century Gothic&quo=
t;,&quot;sans-serif&quot;;color:#999999">Mathias Schuch </span><span style=
=3D"font-size:10.0pt;font-family:&quot;Century Gothic&quot;,&quot;sans-seri=
f&quot;;color:#ff0018">|</span><span style=3D"font-size:10.0pt;font-family:=
&quot;Century Gothic&quot;,&quot;sans-serif&quot;;color:#999999"> Unified S=
erver Applications </span><span style=3D"font-size:10.0pt;font-family:&quot=
;Century Gothic&quot;,&quot;sans-serif&quot;;color:#ff0018">|<br>

</span><span style=3D"font-size:10.0pt;font-family:&quot;Century Gothic&quo=
t;,&quot;sans-serif&quot;;color:#999999">Avaya GmbH &amp; Co KG </span><spa=
n style=3D"font-size:10.0pt;font-family:&quot;Century Gothic&quot;,&quot;sa=
ns-serif&quot;;color:#ff0018">|</span><span style=3D"font-size:10.0pt;font-=
family:&quot;Century Gothic&quot;,&quot;sans-serif&quot;;color:#999999"> Kl=
eyerstra=DFe 94=A0</span><span style=3D"font-size:10.0pt;font-family:&quot;=
Century Gothic&quot;,&quot;sans-serif&quot;;color:#ff0018">|</span><span st=
yle=3D"font-size:10.0pt;font-family:&quot;Century Gothic&quot;,&quot;sans-s=
erif&quot;;color:#999999">=A060326 Frankfurt </span><span style=3D"font-siz=
e:10.0pt;font-family:&quot;Century Gothic&quot;,&quot;sans-serif&quot;;colo=
r:#ff0018">|<br>

</span><span style=3D"font-size:10.0pt;font-family:&quot;Century Gothic&quo=
t;,&quot;sans-serif&quot;;color:#999999">Voice: +49 69 7505 6064 </span><sp=
an style=3D"font-size:10.0pt;font-family:&quot;Century Gothic&quot;,&quot;s=
ans-serif&quot;;color:#ff0018">|</span><span style=3D"font-size:10.0pt;font=
-family:&quot;Century Gothic&quot;,&quot;sans-serif&quot;;color:#999999"> F=
ax:=A0 +49 69 7505 56064 </span><span style=3D"font-size:10.0pt;font-family=
:&quot;Century Gothic&quot;,&quot;sans-serif&quot;;color:#ff0018">|<br>

</span><span style=3D"font-size:10.0pt;font-family:&quot;Century Gothic&quo=
t;,&quot;sans-serif&quot;;color:#999999">Email:</span><span style=3D"font-s=
ize:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#9999=
99"> </span><span style=3D"font-family:&quot;Century Gothic&quot;,&quot;san=
s-serif&quot;;color:#999999"><a href=3D"mailto:[email protected]" target=3D=
"_blank"><span style=3D"font-size:10.0pt;color:gray">[email protected]</spa=
n><span style=3D"font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-=
serif&quot;"> </span></a></span><span style=3D"font-family:&quot;Century Go=
thic&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u><u></u></span></p>

<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ce=
ntury Gothic&quot;,&quot;sans-serif&quot;;color:#999999">Sitz der Gesellsch=
aft: Frankfurt/Main<br>Registergericht: Amtsgericht Frankfurt/Main - HRA 29=
419<br>

Pers. haftender Gesellschafter: Avaya Verwaltungs GmbH in Frankfurt/Main<br=
>Registergericht: Amtsgericht Frankfurt/Main - HRB 76816<br>Gesch=E4ftsf=FC=
hrer: Markus Ernesti, Dr. Wolfgang Runge, Wolfgang Zorn<br><br>Erreichen Si=
e den richtigen Avaya Ansprechpartner mit kostenfreien Rufnummern: <br>

Tel: 0800-GOAVAYA =3D 0800 46 28 29 2 </span><span style=3D"font-size:10.0p=
t;font-family:&quot;Century Gothic&quot;,&quot;sans-serif&quot;;color:#ff00=
33">|</span><span style=3D"font-size:10.0pt;font-family:&quot;Century Gothi=
c&quot;,&quot;sans-serif&quot;;color:#999999"> Fax: 0800-AVAYAFAX =3D 0800 =
28 29 23 29<br>

<br>Ihr direkter Zugang zu unserem Kundenportal MeinAvaya: <a href=3D"http:=
//www.meinavaya.de" target=3D"_blank">www.meinavaya.de<br></a><br></span><a=
 href=3D"http://twitter.com/#!/Avaya_D" target=3D"_blank"><span style=3D"fo=
nt-size:10.0pt;font-family:&quot;Century Gothic&quot;,&quot;sans-serif&quot=
;;text-decoration:none"><img border=3D"0" width=3D"16" height=3D"16"></span=
></a><a href=3D"http://www.facebook.com/AvayaDeutschland" target=3D"_blank"=
><span style=3D"font-size:10.0pt;font-family:&quot;Century Gothic&quot;,&qu=
ot;sans-serif&quot;;text-decoration:none"><img border=3D"0" width=3D"17" he=
ight=3D"16"></span></a><a href=3D"http://www.youtube.com/AvayaDeutschland" =
target=3D"_blank"><span style=3D"font-size:10.0pt;font-family:&quot;Century=
 Gothic&quot;,&quot;sans-serif&quot;;text-decoration:none"><img border=3D"0=
" width=3D"17" height=3D"17"></span></a><a href=3D"http://www.xing.com/comp=
anies/avaya" target=3D"_blank"><span style=3D"font-size:10.0pt;font-family:=
&quot;Century Gothic&quot;,&quot;sans-serif&quot;;text-decoration:none"><im=
g border=3D"0" width=3D"16" height=3D"16"></span></a><a href=3D"http://www.=
linkedin.com/companies/1494?trk=3DNUS_CMPY_FOL-co" target=3D"_blank"><span =
style=3D"font-size:10.0pt;font-family:&quot;Century Gothic&quot;,&quot;sans=
-serif&quot;;text-decoration:none"><img border=3D"0" width=3D"17" height=3D=
"16"></span></a><a href=3D"http://www.flickr.com/photos/avaya" target=3D"_b=
lank"><span style=3D"font-size:10.0pt;font-family:&quot;Century Gothic&quot=
;,&quot;sans-serif&quot;;text-decoration:none"><img border=3D"0" width=3D"1=
6" height=3D"16"></span></a><a href=3D"http://www.avaya.com/blogs" target=
=3D"_blank"><span style=3D"font-size:10.0pt;font-family:&quot;Century Gothi=
c&quot;,&quot;sans-serif&quot;;text-decoration:none"><img border=3D"0" widt=
h=3D"16" height=3D"16"></span></a><span style=3D"font-size:10.0pt;font-fami=
ly:&quot;Century Gothic&quot;,&quot;sans-serif&quot;;color:#999999"><a href=
=3D"http://www.meinavaya.de" target=3D"_blank"><br>

<br></a></span><span style=3D"font-size:7.5pt;font-family:&quot;Century Got=
hic&quot;,&quot;sans-serif&quot;;color:#009900">[ Bitte denken Sie =FCber I=
hre Verantwortung gegen=FCber der Umwelt nach, bevor Sie diese E-Mail ausdr=
ucken! ]</span><span style=3D"font-size:11.0pt;font-family:&quot;Calibri&qu=
ot;,&quot;sans-serif&quot;;color:#1f497d"><u></u><u></u></span></p>

</div><p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:&q=
uot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u>=A0<u></u></sp=
an></p><div style=3D"border:none;border-top:solid #b5c4df 1.0pt;padding:3.0=
pt 0cm 0cm 0cm">

<p class=3D"MsoNormal"><b><span style=3D"font-size:10.0pt;font-family:&quot=
;Tahoma&quot;,&quot;sans-serif&quot;">Von:</span></b><span style=3D"font-si=
ze:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> <a href=
=3D"mailto:[email protected]" target=3D"_blank">[email protected]=
om</a> [mailto:<a href=3D"mailto:[email protected]" target=3D"_blank"=
>[email protected]</a>] <b>Im Auftrag von </b>Guillaume Sauthier (OW2=
)<br>

<b>Gesendet:</b> Donnerstag, 19. Januar 2012 12:03<br><b>An:</b> <a href=3D=
"mailto:[email protected]" target=3D"_blank">[email protected]</a><br><b>Betreff:</=
b> [jonas] Re: log4j<u></u><u></u></span></p></div><div><div><p class=3D"Ms=
oNormal">

<u></u>=A0<u></u></p><p class=3D"MsoNormal">What is your version of JOnAS ?=
<u></u><u></u></p><div><p class=3D"MsoNormal" style=3D"margin-bottom:12.0pt=
">--G<u></u><u></u></p><div><p class=3D"MsoNormal">2012/1/17 &lt;<a href=3D=
"mailto:[email protected]" target=3D"_blank">[email protected]</a>&gt;<u></=
u><u></u></p>

<p class=3D"MsoNormal">Hi,<br><br>i want to use log4j with JOnAS. I follow =
the configuration guide and putt the<br>log4j.properties in $JONAS_BASE/con=
f and log4j jar file in<br>$JONAS_BASE/lib/commons.<br>If I now uncomment i=
n trace.properties the wrapper:<br>

&quot;log.config.classname<br>org.objectweb.util.monolog.wrapper.log4j.Mono=
logLoggerFactory&quot;<br>and comment the wrapper:<br>&quot;log.config.clas=
sname org.objectweb.util.monolog.wrapper.javaLog.LoggerFactory&quot;<br>

I get the following execption:<br>&quot;Cannot get LoggerFactory:java.lang.=
ClassNotFoundException:<br>org.objectweb.util.monolog.wrapper.log4j.Monolog=
LoggerFactory&quot;<br><br>What am I doing wrong?<br><br>Thanks<br>Mathias<=
u></u><u></u></p>

</div><p class=3D"MsoNormal"><u></u>=A0<u></u></p></div></div></div></div><=
/div></blockquote></div><br></div></div>

--bcaec554d9082a3c5704b6f1af90--