RE: Getting "Could not find root logger information" but I don't see why

2011-05-26 Thread KARR, DAVID (ATTSI)
> -Original Message-
> From: Jacob Kjome [mailto:h...@visi.com]
> Sent: Thursday, May 26, 2011 2:15 PM
> To: Log4J Users List
> Subject: Re: Getting "Could not find root logger information" but I
> don't see why
> 
> 
> >Due to some other constraints, I appear to be
> >forced to have my log4j.jar at both the EAR and WAR classpath
> level.  In my
> >WebLogic config, I'm doing everything I can to make it "prefer" the
> jars in
> >the webapp.
> >
> 
> If you are using Weblogic 9.2+, then you may be able to use a
>  FilteringClassLoader [1], so that application library contents of the
> EAR
> file are loaded in preference to those from the server  classpath.  In
> "META-INF/weblogic-application.xml" you'd add the following
> 
> 
>     org.apache.log4j.*
> 
> 
> You'd simply make sure to place log4j.jar in the EAR's APP-INF/lib or
> add it
> as a manifest Class-Path entry in the EAR's manifest.mf.  Note that I
> haven't
> verified whether this actually achieves per/app  logging
> configuration.  Maybe
> you can try it out and report results?

This whole issue became somewhat moot when I discovered that the other library, 
which said it uses Log4J, is actually directly using java.util.logging, so I 
was able to implement a separate configuration setup for that.

However, it's only a matter of time before we end up with more than one webapp 
using log4j.  I'll have to dive into this again when we get to that point.

I'm familiar with all of the "prefer" elements in WebLogic's config, so we'll 
see what happens.

> 
> [1]
> http://download.oracle.com/docs/cd/E13222_01/wls/docs92/programming/cla
> ssloading.html#wp1097187
> 
> 
> Jake
> 
> -
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org


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



Re: Getting "Could not find root logger information" but I don't see why

2011-05-26 Thread Jacob Kjome


Due to some other constraints, I appear to be 
forced to have my log4j.jar at both the EAR and WAR classpath level.  In my 
WebLogic config, I'm doing everything I can to make it "prefer" the jars in 
the webapp.




If you are using Weblogic 9.2+, then you may be able to use a 
FilteringClassLoader [1], so that application library contents of the EAR 
file are loaded in preference to those from the server  classpath.  In 
"META-INF/weblogic-application.xml" you'd add the following



    org.apache.log4j.*


You'd simply make sure to place log4j.jar in the EAR's APP-INF/lib or add it 
as a manifest Class-Path entry in the EAR's manifest.mf.  Note that I haven't 
verified whether this actually achieves per/app  logging configuration.  Maybe 
you can try it out and report results?


[1] 
http://download.oracle.com/docs/cd/E13222_01/wls/docs92/programming/classloading.html#wp1097187



Jake

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



Re: using of system properties in subject of SMTPAppender

2011-05-26 Thread Jacob Kjome


You might be interested in the "it.openutils.log4j.AlternateSMTPAppender" 
[1].  It allows for dynamic subjects and more.  Note that I am not affiliated 
with this project.  I just found it to be useful.



[1] http://www.openmindlab.com/lab/tools/openutilslog4j/smtp.html


Jake


On Mon, 23 May 2011 16:18:20 +0200
 Zbynek Vavros  wrote:



Hi,

I have a 1 server app and many clients app on different servers.
Obviously I wanted to know from which server the email comes, so I used
this:

log4j.xml

  
  
  
  
  
  

  
  


  


and since system property has to be setup before configuring log4j, I use
this in my code.

Main class
//create system property to hold server name
System.setProperty("HOSTNAME", InetAddress.getLocalHost
().getCanonicalHostName());

//reconfigure log4j so it picks up HOSTNAME property
DOMConfigurator.configure(getClass().getClassLoader().getResource(
"log4j.xml"));

Then Im receiving emails with subject like this: "Agent on [127.0.0.1] has
encountered error".
So far so good.
And now I have request to include customer name in subject.
I have no problem to include it in stack trace, but since I cannot set
customer name the same way
as I did with IP (there are multiple customers handled by my app so I
cannot just use System.setProperty("CUSTOMER", "SOME NAME")).

I though of solution to set this property when exception is catched and
reconfigure log4j after setting proper customer name into system property.
But I think it is politelly said "ugly".

Can some1 suggest a better way maybe?

Thanks, Zbynek


 
Kind Regards / Mit  
freundlichen Grüßen /   
Üdvözlettel / S 
pozdravem:  
 
 
Zbynek VAVROS (Embedded 
Development image moved 
to file: 
   pic20342.gif) 
 
 Delivery Centre  616 00, Brno   
  Central Europe  Technicka 21   
Brno SITE Czech Republic 
 
(Embedded image moved to

   file: pic17964.gif)Phone: 420-53341- x6283
  Mobile:
  E-mail: zbynek_vav...@cz.ibm.com   
 
 
 
 
   IBM Global Services   
  Delivery Center Czech  

 Republic, s.r.o.
   Registered address:   
Brno, Technicka 2995/21,

Zip code: 61600, Company
   ID: 26244535  
  Entered in the 
   Commercial Register   
maintained by the
  Regional Court in Brno 
  (Part C, Entry 39922)  
 
   IBM Global Services   
  Delivery Center Czech  

 Republic, s.r.o.
  Sídlo: Brno, Technická 
  2995/21, PSČ 61600 IČ: 
 26244535
   Zapsaná v obchodním   
rejstříku, vedeném   
  Krajským soudem v Brně 

RE: Getting "Could not find root logger information" but I don't see why

2011-05-26 Thread KARR, DAVID (ATTSI)
> -Original Message-
> From: Jacob Kjome [mailto:h...@visi.com]
> Sent: Thursday, May 26, 2011 9:35 AM
> To: Log4J Users List
> Subject: Re: Getting "Could not find root logger information" but I
> don't see why
> 
> Is that a literal path?
> 
> "...\my.ear\my.war\WEB-INF/log4j.xml"

No, the real path information is elided.  This part works fine.

> Also, keep in mind that because you are not [likely] using a logger
> repository
> selector, you will be using the default logger repository unless you
> are using
> child-first, or parent-last, classloading.  If you want per/webapp
> logger
> configuration, this is a must.  Otherwise, you might as well place
> log4j.xml
> in the server's classpath.

This is something I definitely need to get more information about.  I'll read 
the docs on this and work on implementing this.

> And if you aren't doing anything special
> regarding
> setting runtime properties for you configuration to use, then it is
> rather
> pointless to use a custom Log4j init servlet.  Just place log4j.xml in
> WEB-INF/classes and be done.  Log4j will automatically pick this up and
> use
> it.

Yeah, I'm aware of that, and once I eliminate some other issues, I plan on 
eliminating that.  However, I may have a classpath issue that may end up 
requiring this.  I'm not sure.  Due to some other constraints, I appear to be 
forced to have my log4j.jar at both the EAR and WAR classpath level.  In my 
WebLogic config, I'm doing everything I can to make it "prefer" the jars in the 
webapp.

> 
> 
> Jake
> 
> On Thu, 26 May 2011 01:27:42 +
>  "KARR, DAVID (ATTSI)"  wrote:
> > Using log4j 1.2.16 in WebLogic 10.3.2.
> >
> > While my app is starting up, I'm seeing the following message:
> >
> > Log4JInitServlet is initializing log4j
> > Initializing log4j with: ...\my.ear\my.war\WEB-INF/log4j.xml
> > log4j: Could not find root logger information. Is this OK?
> >
> > This is the log4j.xml file it's reading:
> > -
> > 
> >  "http://jakarta.apache.org/log4j.dtd";>
> > 
> > >class="org.apache.log4j.ConsoleAppender">
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > 
> > -
> >
> > I don't see anything wrong with this.
> >
> > -
> > To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> >For additional commands, e-mail: log4j-user-h...@logging.apache.org
> >
> >
> 
> 
> -
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org


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



Re: Relative path of file appender

2011-05-26 Thread Jacob Kjome


Yes.  It will be relative to the directory from which the JVM started from.

Jake

On Thu, 26 May 2011 17:32:00 +0100
 Jiafan Zhou  wrote:

The following log4j.properties uses a relative path for redirected file. Is
it valid?

log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=./output.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=5
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L -
%m%n



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



Re: Getting "Could not find root logger information" but I don't see why

2011-05-26 Thread Jacob Kjome

Is that a literal path?

"...\my.ear\my.war\WEB-INF/log4j.xml"

First, it's invalid since it has 3 periods, rather than 1 or 2.  Second, your 
slashes are inconsistent.  If you want to be agnostic to the OS, just always 
use forward slashes ("/"), which will work under both Unix and Windows in 
Java.  Third, when using relative paths, the path is going to be relative to 
the directory from which the JVM started.  So, let's say this is...


${weblogic.home}/server/bin

Log4j would be looking for your file in

${weblogic.home}/server/my.ear/my.war/WEB-INF/log4j.xml

...which is almost certainly incorrect.

Also, keep in mind that because you are not [likely] using a logger repository 
selector, you will be using the default logger repository unless you are using 
child-first, or parent-last, classloading.  If you want per/webapp logger 
configuration, this is a must.  Otherwise, you might as well place log4j.xml 
in the server's classpath.  And if you aren't doing anything special regarding 
setting runtime properties for you configuration to use, then it is rather 
pointless to use a custom Log4j init servlet.  Just place log4j.xml in 
WEB-INF/classes and be done.  Log4j will automatically pick this up and use 
it.



Jake

On Thu, 26 May 2011 01:27:42 +
 "KARR, DAVID (ATTSI)"  wrote:

Using log4j 1.2.16 in WebLogic 10.3.2.

While my app is starting up, I'm seeing the following message:

Log4JInitServlet is initializing log4j
Initializing log4j with: ...\my.ear\my.war\WEB-INF/log4j.xml
log4j: Could not find root logger information. Is this OK?

This is the log4j.xml file it's reading:
-

http://jakarta.apache.org/log4j.dtd";>

class="org.apache.log4j.ConsoleAppender">
















-

I don't see anything wrong with this.

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





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



Relative path of file appender

2011-05-26 Thread Jiafan Zhou
The following log4j.properties uses a relative path for redirected file. Is
it valid?

log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=./output.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=5
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L -
%m%n


RE: Getting "Could not find root logger information" but I don't see why

2011-05-26 Thread KARR, DAVID (ATTSI)
> -Original Message-
> From: KARR, DAVID (ATTSI)
> Sent: Wednesday, May 25, 2011 6:28 PM
> To: log4j-user@logging.apache.org
> Subject: Getting "Could not find root logger information" but I don't
> see why
> 
> Using log4j 1.2.16 in WebLogic 10.3.2.
> 
> While my app is starting up, I'm seeing the following message:
> 
> Log4JInitServlet is initializing log4j
> Initializing log4j with: ...\my.ear\my.war\WEB-INF/log4j.xml
> log4j: Could not find root logger information. Is this OK?

Never mind.  This is the message you would see when you try to call 
PropertyConfigurator on a log4j.xml file.  Brain damage repaired.

> This is the log4j.xml file it's reading:
> -
> 
>  "http://jakarta.apache.org/log4j.dtd";>
> 
>  class="org.apache.log4j.ConsoleAppender">
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -
> 
> I don't see anything wrong with this.
> 
> -
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org


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



Using CompositeTriggeringPolicy with log4j.xml

2011-05-26 Thread Thomas Fischer
Hello all,

I want to configure a CompositeTriggeringPolicy inside my log4j.xml, but I have 
not been able to find any documentation on how to pass individual triggering 
policies to it. The Javadoc doesn't seem to address the issue. Could anyone 
please give me a short example of how this is supposed to be done?

Mit freundlichen Grüßen / Best Regards

Thomas Fischer
__
***
Besuchen Sie uns auf der stb marketplace Essen 2011
am 8. Juni 2011 im Congress Center Essen, Stand C18
***
Thomas Fischer
Softwareentwickler
Tel: +49 (0) 911 / 23 75 99-121
Fax: +49 (0) 911 / 23 75 99-13
t.fisc...@up2date-solutions.de
www.up2date-solutions.de
up2date solutions GmbH
Prinzregentenufer 3, D-90489 Nürnberg
Amtsgericht Nürnberg HRB 17 042, UST. ID. Nr. DE206 915 429
Geschäftsführer
Wolfgang Burger - Andreas Mändlein - Stephan Ottenschläger - Uwe Waffenschmidt
__
VERTRAULICHKEITSHINWEIS: Diese E-Mail enthält vertrauliche und/oder rechtlich 
geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail 
irrtümlich erhalten
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. 
Das unerlaubte
Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet. Jede 
Form der
Kenntnisnahme oder Weitergabe durch Dritte ist unzulässig. Wir überwachen und 
untersuchen
von uns versandte E-Mails auf Viren, gleichwohl können wir keine Haftung für 
Schäden durch von
dritter Seite angehängte Viren oder Veränderungen übernehmen.
CONFIDENTIALITY NOTICE: This e-mail message (including all attachments) is for 
sole use of
the intended recipient(s) and may contain confidential and/or privileged 
information. Any
unauthorised review, use, disclosure, copying or distribution is strictly 
prohibited. If you are
not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies
of the original message. We do not accept any responsibility for damages caused 
anyhow by
viruses transmitted via email.