If you're in a J2SE application you either need to give the full path, or a
relative path for the file based on the process space's working directory.
Most IDE's have a way to set this for runtime, just set the working
directory to the location of your config file.

If you're in a J2EE application the story is more complicated.  Read further
down the short manual for more info.  A "startup servlet" is the recommended
approach and the documentation describes how to "build" the path to the
file.


-----Original Message-----
From: Javier [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 11, 2004 10:48 AM
To: Log4J Users List
Subject: RE: Can4t write logs


> 
> One thing that's "unusual" - using the root logger. 
> It's generally
> recommended to use the getLogger method and name
> your loggers with the class
> FQCN, else you lose much of the power of Log4j (see
> http://logging.apache.org/log4j/docs/manual.html).
> 


Hi

I?ve been reading the doc again and now I see the
light :)

Then my application now use this:

------------
private static Logger logger =
Logger.getLogger("AplicacionA.class");

PropertyConfigurator.configure("aprop.properties");
        logger.info("Entering application.");

--------------

Now I?ve a new problem (partially solved): if I not
pass a full path to configure method, it can't find my
properties file.

It?s normal this ?
How could I get the current application path ? (I
could imagine writeing a file and getting a path, but
I want to know if there are a more "sophisticated"
method..).

Thanks in advance

Javier


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-------------------------------------------------------------------------------
This message and any included attachments are from Siemens Medical Solutions 
USA, Inc. and are intended only for the addressee(s).  
The information contained herein may include trade secrets or privileged or 
otherwise confidential information.  Unauthorized review, forwarding, printing, 
copying, distributing, or using such information is strictly prohibited and may 
be unlawful.  If you received this message in error, or have reason to believe 
you are not authorized to receive it, please promptly delete this message and 
notify the sender by e-mail with a copy to [EMAIL PROTECTED] 

Thank you

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to