RE: locating my log4j.properties file

2010-11-19 Thread Don Raikes
Hello,

Ok so now I just need a working example of a log4j.properties file.

My desire is to have a console logger with level debug and a file appender with 
log level = warn.

I have been away from this for a while, but now need to quickly do some logging 
for a project I am working on, and don't have a lot of time for tinkering 
around with properties files.

Any help would be greatly appreciated.

-Original Message-
From: Jacob Kjome [mailto:h...@visi.com] 
Sent: Sunday, October 10, 2010 9:11 AM
To: Log4J Users List
Subject: Re: locating my log4j.properties file



On 10/8/2010 3:37 PM, Don Raikes wrote:
 Hello again,
 
 Ok so I solved some of my issues, but now I have others.
 
 In my log4j.properties file, I have configured 3 appenders.
 A1console apppender
 A2file appender to my errors.log file
 A3file appender to my fulltrace log file (see below)
 
 When I run the test program using -Dlog4j.debug, I can see that all the 
 appenders are being created no problem.
 
 However, nothing is being written to either of my file appenders a2 or a3 
 even though my console appender (a1) is receiving all the output).
 
 Any suggestions on how I have misconfigured things would be appreciated.

I don't see any problems at all, other than, likely, a misunderstanding of what 
is
supposed to occur.  I see 2 loggers with A2 and A3 appenders attached,
respectively

log4j.logger.org.apache.log4j.errors=ERROR, A2
log4j.logger.org.apache.log4j.fulltrace=DEBUG, A3


Given that neither of these logger names match up with any package/class you 
would
be using, it makes perfect sense that you'd see no logging output for this.  And
I'm not sure where you came up with these logger names anyway, other than 
possibly
some documentation relating to the abandoned Log4j-1.3 effort which attempted to
use itself for logging.

Try the following logger definitions.  And note that I set the root logger to
WARN rather than DEBUG.  That way, annoying debug messages coming from 
various
frameworks like Spring, some of the various apache commons frameworks, etc...,
won't unnecessarily pollute your logs.  Also, I added Threshold=ERROR to the 
A2
appender so that it will reject any logging messages lower than ERROR (I didn't
know what your package was so I called it org.mypackage.  Change as 
needed.)...

log4j.rootLogger=WARN, A1
log4j.logger.org.mypackage=DEBUG, A2, A3
log4j.appender.A2.Threshold=ERROR


Jake

 
 -- beginning of ma11yMonitor-log4j.properties ---
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
 # this work for additional information regarding copyright ownership.
 # The ASF licenses this file to You under the Apache License, Version 2.0
 # (the License); you may not use this file except in compliance with
 # the License.  You may obtain a copy of the License at
 #
 #  http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an AS IS BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 
 # Attach appender A1 to root. Set root level to Level.DEBUG.
 log4j.rootLogger=DEBUG, A1
 
 # A1 is set to be a FileAppender sending its output to
 # System.out. However, only error messages and above will be printed
 # in A1 because A1's threshold is set to Level.ERROR.
 
 # The fact that the root level is set to Prority.DEBUG only influences
 # log requests made to the root logger. It has no influence on the
 # *appenders* attached to root.
 
 log4j.appender.A1=org.apache.log4j.ConsoleAppender
 log4j.appender.A1.Threshold=DEBUG
 
 log4j.appender.A1.layout=org.apache.log4j.PatternLayout
 log4j.appender.A1.layout.ConversionPattern=%p [%t] %c{2} (%M:%L) - %m%n
 
 # Set the level of the logger named org.apache.log4j.errors to 
 # Level.INFO, attach appender A2.
 log4j.logger.org.apache.log4j.errors=ERROR, A2
 
 # Appender A2 writes to the file test in user's home.
 log4j.appender.A2=org.apache.log4j.FileAppender
 log4j.appender.A2.File=${user.home}/a11yMonitor-errors.log
 
 # Truncate 'test' if it aleady exists.
 log4j.appender.A2.Append=false
 
 # Appender A2 uses the PatternLayout.
 log4j.appender.A2.layout=org.apache.log4j.PatternLayout
 log4j.appender.A2.layout.ConversionPattern=%5r %-5p [%t] %c{2} - %m%n
 
 
 
 log4j.logger.org.apache.log4j.fulltrace=DEBUG, A3
 
 # Appender A2 writes to the file a11y-fulltrace.log in user's home.
 log4j.appender.A3=org.apache.log4j.FileAppender
 log4j.appender.A3.File=${user.home}/a11yMonitor-fulltrace.log
 
 # Truncate 'test' if it aleady exists.
 log4j.appender.A3.Append=false
 
 # Appender A3 uses the PatternLayout.
 log4j.appender.A3.layout=org.apache.log4j.PatternLayout
 log4j.appender.A3.layout.ConversionPattern=%5r %-5p [%t] %c{2

Re: locating my log4j.properties file

2010-11-19 Thread Curt Arnold

On Nov 19, 2010, at 12:10 PM, Don Raikes wrote:

 Hello,
 
 Ok so now I just need a working example of a log4j.properties file.
 
 My desire is to have a console logger with level debug and a file appender 
 with log level = warn.
 
 I have been away from this for a while, but now need to quickly do some 
 logging for a project I am working on, and don't have a lot of time for 
 tinkering around with properties files.
 
 Any help would be greatly appreciated.
 

Look at the tests/input directory for all the property files used in the unit 
tests.  All of them would be a working property file.

In your case, you need to attach both appenders to the root, set the level of 
the root to debug and set a threshold of warn on the file appender.  Here is an 
untested example:


log4j.rootLogger=DEBUG, FileAppender, ConsoleAppender
log4j.appender.FileAppender=org.apache.log4j.FileAppender
log4j.appender.FileAppender.file=output/temp
log4j.appender.FileAppender.threshold=WARN
log4j.appender.FileAppender.layout=org.apache.log4j.PatternLayout 
log4j.appender.FileAppender.layout.ConversionPattern=%-5p - %m%n
log4j.appender.ConsoleAppender=org.apache.log4j.ConsoleAppender
log4j.appender.ConsoleAppender.layout=org.apache.log4j.PatternLayout 
log4j.appender.ConsoleAppender.layout.ConversionPattern=%-5p - %m%n



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



Re: locating my log4j.properties file

2010-10-10 Thread Jacob Kjome
);
 
 }
 
 --- end of class constructor ---
 
 I have logger statements inside each of my class's methods with level set to 
 info.
 
 -Original Message-
 From: Christian Grobmeier [mailto:grobme...@gmail.com] 
 Sent: Thursday, October 07, 2010 10:40 PM
 To: Log4J Users List
 Subject: Re: locating my log4j.properties file
 
 Hello
 
 start your programm with:
 -Dlog4j.debug
 
 This will show you information were it looks for your properties file.
 It usually helps me in this case
 Cheers
 Christian
 
 On Fri, Oct 8, 2010 at 12:39 AM, Don Raikes don.rai...@oracle.com wrote:
 Hello,

 I have a java project which I compile and then package in a jar file which 
 goes into my jdk_home\jre\lib\ext folder (it is an extension to my jdk).

 In the main class of my application I tell log4j to use a specific 
 log4j.properties file

 PropertyConfigurator.configure(a11yMonitor-log4j.properties);

 Where do I actually place the a11yMonitor-log4j.properties file?

 I tried in jdk_home\jre\lib and jdk_home\jre\lib\ext but both times I tried 
 to run my extension, I get a message saying that log4j cannot find the 
 properties file.

 Any help would be greatly appreciated.

 --
 Sincerely,

 HYPERLINK http://www.oracle.com; \nOracle
 Donald Raikes | Accessibility Specialist
 Phone: HYPERLINK tel:+16028246213+16028246213 | Mobile: HYPERLINK 
 tel:+15202717608+15202717608 | VOIP: HYPERLINK 
 tel:+16028246213+16028246213
 Oracle JDeveloper Quality Assurance
 | Tucson, Arizona

 HYPERLINK http://www.oracle.com/commitment; \nGreen Oracle  Oracle is 
 committed to developing practices and products that help protect the 
 environment

 
 -
 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: locating my log4j.properties file

2010-10-09 Thread Thorbjørn Ravn Andersen

 Den 08/10/10 00.39, Don Raikes skrev:

Hello,

I have a java project which I compile and then package in a jar file which goes 
into my jdk_home\jre\lib\ext folder (it is an extension to my jdk).
I would recommend against using the extension mechanism as this changes 
the global behaviour of this JDK which may cause _other_ Java programs 
using this JDK to unexpectantly change behaviour causing bugs that can 
be very hard to find.


What is the reason for you not just having an extra jar in your classpath?

--
  Thorbjørn Ravn Andersen  ...plus... Tubular Bells!


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



Re: locating my log4j.properties file

2010-10-08 Thread Jacob Kjome
It's great that you got it working, but it doesn't appear you fully understand 
why...

configure(String) [1] takes a java.io.File path.  Given that you have provided a
relative path, rather than a fully qualified one, location of the file is going 
to
be relative to the directory from which you started your JVM.  In your case, it
happens to be the same directory in which your Jar file exists.  But you can't
depend on this because your JVM may be started from another directory and this
relative location may become invalid.  And you generally want to avoid the File
system anyway in your Java programs to keep them from being coupled to a
particular environment setup.  For these reasons, I suggest that you use a URL 
[2]
instead and load your config file from the classpath, e.g.,

URL url =
getClass().getClassLoader().getResource(com/mypackage/log4j-config-file.properties);
PropertyConfigurator.configure(url);


But lets step back for a second.  Unless you are doing something special as far 
as
loading the config file, there's no reason you can't rename your config file to
log4j.properties.  This will get picked up automatically without you having to
manually configure Log4j.  Just place it in the root package on your classpath 
and
it will get picked up (unless log4j.xml also exists, in which case it will be 
used
in preference to log4j.properties).

The other option, which also avoids manual, programmatic, configuration is to 
set
the property log4j.configuration, e.g.,

Example of a URL on Windows...
-Dlog4j.configuration=file:/C:/some/path/to/my/log4j-config-file.properties

Example of a URL on UNIX...
-Dlog4j.configuration=file:/some/path/to/my/log4j-config-file.properties



[1]
http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PropertyConfigurator.html#configure%28java.lang.String%29
[2]
http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PropertyConfigurator.html#configure%28java.net.URL%29


Jake

On 10/8/2010 9:45 AM, Don Raikes wrote:
 Christian,
 
 Thanks, with the -Dlog4j.debug, I was able to figure out that log4j was 
 looking for a default log4j.xml file which I do not have, but I then copied 
 the a11yMonitor-log4j.properties into the same folder as my test 
 application's jar file  and that worked.  Getting log4j output now!
 
 -Original Message-
 From: Christian Grobmeier [mailto:grobme...@gmail.com] 
 Sent: Thursday, October 07, 2010 10:40 PM
 To: Log4J Users List
 Subject: Re: locating my log4j.properties file
 
 Hello
 
 start your programm with:
 -Dlog4j.debug
 
 This will show you information were it looks for your properties file.
 It usually helps me in this case
 Cheers
 Christian
 
 On Fri, Oct 8, 2010 at 12:39 AM, Don Raikes don.rai...@oracle.com wrote:
 Hello,

 I have a java project which I compile and then package in a jar file which 
 goes into my jdk_home\jre\lib\ext folder (it is an extension to my jdk).

 In the main class of my application I tell log4j to use a specific 
 log4j.properties file

 PropertyConfigurator.configure(a11yMonitor-log4j.properties);

 Where do I actually place the a11yMonitor-log4j.properties file?

 I tried in jdk_home\jre\lib and jdk_home\jre\lib\ext but both times I tried 
 to run my extension, I get a message saying that log4j cannot find the 
 properties file.

 Any help would be greatly appreciated.

 --
 Sincerely,

 HYPERLINK http://www.oracle.com; \nOracle
 Donald Raikes | Accessibility Specialist
 Phone: HYPERLINK tel:+16028246213+16028246213 | Mobile: HYPERLINK 
 tel:+15202717608+15202717608 | VOIP: HYPERLINK 
 tel:+16028246213+16028246213
 Oracle JDeveloper Quality Assurance
 | Tucson, Arizona

 HYPERLINK http://www.oracle.com/commitment; \nGreen Oracle  Oracle is 
 committed to developing practices and products that help protect the 
 environment

 
 -
 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: locating my log4j.properties file

2010-10-08 Thread Don Raikes
Jake,

I will take all this into account in my final production setup.

For now I was using the log4j as a debugging tool for myself, so just wanted to 
figure out how it works.

-Original Message-
From: Jacob Kjome [mailto:h...@visi.com] 
Sent: Friday, October 08, 2010 10:51 AM
To: Log4J Users List
Subject: Re: locating my log4j.properties file

It's great that you got it working, but it doesn't appear you fully understand 
why...

configure(String) [1] takes a java.io.File path.  Given that you have provided a
relative path, rather than a fully qualified one, location of the file is going 
to
be relative to the directory from which you started your JVM.  In your case, it
happens to be the same directory in which your Jar file exists.  But you can't
depend on this because your JVM may be started from another directory and this
relative location may become invalid.  And you generally want to avoid the File
system anyway in your Java programs to keep them from being coupled to a
particular environment setup.  For these reasons, I suggest that you use a URL 
[2]
instead and load your config file from the classpath, e.g.,

URL url =
getClass().getClassLoader().getResource(com/mypackage/log4j-config-file.properties);
PropertyConfigurator.configure(url);


But lets step back for a second.  Unless you are doing something special as far 
as
loading the config file, there's no reason you can't rename your config file to
log4j.properties.  This will get picked up automatically without you having to
manually configure Log4j.  Just place it in the root package on your classpath 
and
it will get picked up (unless log4j.xml also exists, in which case it will be 
used
in preference to log4j.properties).

The other option, which also avoids manual, programmatic, configuration is to 
set
the property log4j.configuration, e.g.,

Example of a URL on Windows...
-Dlog4j.configuration=file:/C:/some/path/to/my/log4j-config-file.properties

Example of a URL on UNIX...
-Dlog4j.configuration=file:/some/path/to/my/log4j-config-file.properties



[1]
http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PropertyConfigurator.html#configure%28java.lang.String%29
[2]
http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PropertyConfigurator.html#configure%28java.net.URL%29


Jake

On 10/8/2010 9:45 AM, Don Raikes wrote:
 Christian,
 
 Thanks, with the -Dlog4j.debug, I was able to figure out that log4j was 
 looking for a default log4j.xml file which I do not have, but I then copied 
 the a11yMonitor-log4j.properties into the same folder as my test 
 application's jar file  and that worked.  Getting log4j output now!
 
 -Original Message-
 From: Christian Grobmeier [mailto:grobme...@gmail.com] 
 Sent: Thursday, October 07, 2010 10:40 PM
 To: Log4J Users List
 Subject: Re: locating my log4j.properties file
 
 Hello
 
 start your programm with:
 -Dlog4j.debug
 
 This will show you information were it looks for your properties file.
 It usually helps me in this case
 Cheers
 Christian
 
 On Fri, Oct 8, 2010 at 12:39 AM, Don Raikes don.rai...@oracle.com wrote:
 Hello,

 I have a java project which I compile and then package in a jar file which 
 goes into my jdk_home\jre\lib\ext folder (it is an extension to my jdk).

 In the main class of my application I tell log4j to use a specific 
 log4j.properties file

 PropertyConfigurator.configure(a11yMonitor-log4j.properties);

 Where do I actually place the a11yMonitor-log4j.properties file?

 I tried in jdk_home\jre\lib and jdk_home\jre\lib\ext but both times I tried 
 to run my extension, I get a message saying that log4j cannot find the 
 properties file.

 Any help would be greatly appreciated.

 --
 Sincerely,

 HYPERLINK http://www.oracle.com; \nOracle
 Donald Raikes | Accessibility Specialist
 Phone: HYPERLINK tel:+16028246213+16028246213 | Mobile: HYPERLINK 
 tel:+15202717608+15202717608 | VOIP: HYPERLINK 
 tel:+16028246213+16028246213
 Oracle JDeveloper Quality Assurance
 | Tucson, Arizona

 HYPERLINK http://www.oracle.com/commitment; \nGreen Oracle  Oracle is 
 committed to developing practices and products that help protect the 
 environment

 
 -
 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


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

RE: locating my log4j.properties file

2010-10-08 Thread Don Raikes
Hello again,

Ok so I solved some of my issues, but now I have others.

In my log4j.properties file, I have configured 3 appenders.
A1  console apppender
A2  file appender to my errors.log file
A3  file appender to my fulltrace log file (see below)

When I run the test program using -Dlog4j.debug, I can see that all the 
appenders are being created no problem.

However, nothing is being written to either of my file appenders a2 or a3 even 
though my console appender (a1) is receiving all the output).

Any suggestions on how I have misconfigured things would be appreciated.

-- beginning of ma11yMonitor-log4j.properties ---
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the License); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an AS IS BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


# Attach appender A1 to root. Set root level to Level.DEBUG.
log4j.rootLogger=DEBUG, A1

# A1 is set to be a FileAppender sending its output to
# System.out. However, only error messages and above will be printed
# in A1 because A1's threshold is set to Level.ERROR.

# The fact that the root level is set to Prority.DEBUG only influences
# log requests made to the root logger. It has no influence on the
# *appenders* attached to root.

log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.Threshold=DEBUG

log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%p [%t] %c{2} (%M:%L) - %m%n

# Set the level of the logger named org.apache.log4j.errors to 
# Level.INFO, attach appender A2.
log4j.logger.org.apache.log4j.errors=ERROR, A2

# Appender A2 writes to the file test in user's home.
log4j.appender.A2=org.apache.log4j.FileAppender
log4j.appender.A2.File=${user.home}/a11yMonitor-errors.log

# Truncate 'test' if it aleady exists.
log4j.appender.A2.Append=false

# Appender A2 uses the PatternLayout.
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%5r %-5p [%t] %c{2} - %m%n



log4j.logger.org.apache.log4j.fulltrace=DEBUG, A3

# Appender A2 writes to the file a11y-fulltrace.log in user's home.
log4j.appender.A3=org.apache.log4j.FileAppender
log4j.appender.A3.File=${user.home}/a11yMonitor-fulltrace.log

# Truncate 'test' if it aleady exists.
log4j.appender.A3.Append=false

# Appender A3 uses the PatternLayout.
log4j.appender.A3.layout=org.apache.log4j.PatternLayout
log4j.appender.A3.layout.ConversionPattern=%5r %-5p [%t] %c{2} - %m%n

--- end of a11yMonitor-log4j.properties ---

---  class constructor ---
public class Monitor implements FocusListener, WindowFocusListener {
static final Logger logger = Logger.getLogger(Monitor.class);
private String log4jPropertiesFile = null;

public Monitor() {
log4jPropertiesFile =
System.getProperty(user.home) + 
System.getProperty(file.separator) +
a11yMonitor-log4j.properties;
PropertyConfigurator.configure(log4jPropertiesFile);
setupListeners();
logger.info(Loading a11y.Monitor);

}

--- end of class constructor ---

I have logger statements inside each of my class's methods with level set to 
info.

-Original Message-
From: Christian Grobmeier [mailto:grobme...@gmail.com] 
Sent: Thursday, October 07, 2010 10:40 PM
To: Log4J Users List
Subject: Re: locating my log4j.properties file

Hello

start your programm with:
-Dlog4j.debug

This will show you information were it looks for your properties file.
It usually helps me in this case
Cheers
Christian

On Fri, Oct 8, 2010 at 12:39 AM, Don Raikes don.rai...@oracle.com wrote:
 Hello,

 I have a java project which I compile and then package in a jar file which 
 goes into my jdk_home\jre\lib\ext folder (it is an extension to my jdk).

 In the main class of my application I tell log4j to use a specific 
 log4j.properties file

 PropertyConfigurator.configure(a11yMonitor-log4j.properties);

 Where do I actually place the a11yMonitor-log4j.properties file?

 I tried in jdk_home\jre\lib and jdk_home\jre\lib\ext but both times I tried 
 to run my extension, I get a message saying that log4j cannot find the 
 properties file.

 Any help would be greatly appreciated.

 --
 Sincerely,

 HYPERLINK http://www.oracle.com; \nOracle
 Donald Raikes | Accessibility Specialist
 Phone: HYPERLINK tel:+16028246213+16028246213 | Mobile: HYPERLINK 
 tel:+15202717608

locating my log4j.properties file

2010-10-07 Thread Don Raikes
Hello,

I have a java project which I compile and then package in a jar file which goes 
into my jdk_home\jre\lib\ext folder (it is an extension to my jdk).

In the main class of my application I tell log4j to use a specific 
log4j.properties file 

PropertyConfigurator.configure(a11yMonitor-log4j.properties);

Where do I actually place the a11yMonitor-log4j.properties file?

I tried in jdk_home\jre\lib and jdk_home\jre\lib\ext but both times I tried to 
run my extension, I get a message saying that log4j cannot find the properties 
file.

Any help would be greatly appreciated.

-- 
Sincerely, 

HYPERLINK http://www.oracle.com; \nOracle
Donald Raikes | Accessibility Specialist
Phone: HYPERLINK tel:+16028246213+16028246213 | Mobile: HYPERLINK 
tel:+15202717608+15202717608 | VOIP: HYPERLINK tel:+16028246213+16028246213 
Oracle JDeveloper Quality Assurance
| Tucson, Arizona 

HYPERLINK http://www.oracle.com/commitment; \nGreen Oracle  Oracle is 
committed to developing practices and products that help protect the 
environment  


RE: locating my log4j.properties file

2010-10-07 Thread Raghuveer V
Place the property file in root package.


-Original Message-
From: Don Raikes [mailto:don.rai...@oracle.com] 
Sent: Friday, October 08, 2010 4:10 AM
To: log4j-user@logging.apache.org
Subject: locating my log4j.properties file

Hello,

I have a java project which I compile and then package in a jar file which
goes into my jdk_home\jre\lib\ext folder (it is an extension to my jdk).

In the main class of my application I tell log4j to use a specific
log4j.properties file 

PropertyConfigurator.configure(a11yMonitor-log4j.properties);

Where do I actually place the a11yMonitor-log4j.properties file?

I tried in jdk_home\jre\lib and jdk_home\jre\lib\ext but both times I tried
to run my extension, I get a message saying that log4j cannot find the
properties file.

Any help would be greatly appreciated.

-- 
Sincerely, 

HYPERLINK http://www.oracle.com; \nOracle
Donald Raikes | Accessibility Specialist
Phone: HYPERLINK tel:+16028246213+16028246213 | Mobile: HYPERLINK
tel:+15202717608+15202717608 | VOIP: HYPERLINK
tel:+16028246213+16028246213 
Oracle JDeveloper Quality Assurance
| Tucson, Arizona 

HYPERLINK http://www.oracle.com/commitment; \nGreen Oracle  Oracle is
committed to developing practices and products that help protect the
environment  


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



Re: locating my log4j.properties file

2010-10-07 Thread Christian Grobmeier
Hello

start your programm with:
-Dlog4j.debug

This will show you information were it looks for your properties file.
It usually helps me in this case
Cheers
Christian

On Fri, Oct 8, 2010 at 12:39 AM, Don Raikes don.rai...@oracle.com wrote:
 Hello,

 I have a java project which I compile and then package in a jar file which 
 goes into my jdk_home\jre\lib\ext folder (it is an extension to my jdk).

 In the main class of my application I tell log4j to use a specific 
 log4j.properties file

 PropertyConfigurator.configure(a11yMonitor-log4j.properties);

 Where do I actually place the a11yMonitor-log4j.properties file?

 I tried in jdk_home\jre\lib and jdk_home\jre\lib\ext but both times I tried 
 to run my extension, I get a message saying that log4j cannot find the 
 properties file.

 Any help would be greatly appreciated.

 --
 Sincerely,

 HYPERLINK http://www.oracle.com; \nOracle
 Donald Raikes | Accessibility Specialist
 Phone: HYPERLINK tel:+16028246213+16028246213 | Mobile: HYPERLINK 
 tel:+15202717608+15202717608 | VOIP: HYPERLINK 
 tel:+16028246213+16028246213
 Oracle JDeveloper Quality Assurance
 | Tucson, Arizona

 HYPERLINK http://www.oracle.com/commitment; \nGreen Oracle      Oracle is 
 committed to developing practices and products that help protect the 
 environment


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