We help IT Professionals succeed at work.

Turning off log stmt

dkim18
dkim18 asked
on
Medium Priority
227 Views
Last Modified: 2010-03-31
Hi Experts,

I am experimenting with some of the Logging Components. When I used log.info() the log message appears console, but not for log.debug() and I am wondering why.

private Log log = LogFactory.getLog(ResultsAction.class.getName());
log.debug("ActionForward: list()");

Also is there any way that I can turn this log.info() off beside commenting out?

thx,
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016

Commented:
The logging levels are set in your logging file. What level is set? - it needs to be at most debug
CERTIFIED EXPERT
Top Expert 2016
Commented:
>>Also is there any way that I can turn this log.info() off beside commenting out?

Set the level above info

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:

I don't see anything under tomcat/logs dir.( I accidently deleted all files under tomcat/webapps/ while I was playing with a build script and I am not sure this might has something to do with this. )

Commented:
find for all log4j.properties file present in the system PATH.
Also look into the tomcat default directory for that file.
CERTIFIED EXPERT
Top Expert 2016

Commented:
>>find for all log4j.properties file present in the system PATH.

Look for that in the classpath, not path

Author

Commented:
i don't see log4j.properties file in the classpath. what should I do? Is it under tomcat directory?
CERTIFIED EXPERT
Top Expert 2016

Commented:
It must be in the classpath or logging wouldn't work

System.out.println(System.getProperty("java.class.path"));

Author

Commented:
System.out.println(System.getProperty("java.class.path")); gives me this:

C:\apache-tomcat-5.5.12\bin\bootstrap.jar

I set this in the classpath, but no log file was created.
Commented:
>> Look for that in the classpath, not path

I think it looks at the current working directory as well(not PATH).
try sysout(System.getProperty("user.dir"));

and look under that folder.

Author

Commented:
System.getProperty("user.dir")) gave me this and I checked under that dir, but didn't any any log files.

C:\unzipped\eclipse-SDK-3.0-win32\eclipse
CERTIFIED EXPERT
Top Expert 2016

Commented:
>>I think it looks at the current working directory as well(not PATH).

If the current directory is in the classpath, yes

>>but didn't any any log files.

You're not looking for log files - you're looking for log *configuration* files. Search on

log*.properties

Author

Commented:
Ok, I think I finally found it it was under old copied folder. Thanks for all your helps
CERTIFIED EXPERT
Top Expert 2016

Commented:
:-)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.