File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Logging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Logging" Watch "Logging" New topic


Simon Ingram
Ranch Hand

Joined: Nov 30, 2003
Posts: 173
Hi folks,
I tried this question on the SCJD forum but no one seemed interested. I am trying to set up my system to log low level messages, but I'm not having success. On the LogManager class, the Sun docs say that you can edit the file to configure logging for your system. Now how does one do this editing? I tried opening the file with everything I could lay my hands on. No luck, so I tried changing the extension from .properties to .txt. The file was readable and everything inside was exactly as expected. I changed the log level from INFO to ALL, then switched the extension back to .properties and put it into HOME/jre/lib where it came from. I added a few logging messages, but nothing lower than INFO appears. Clearly there are other ways to do this, but that's not the point! How does one edit the file?
Any feedback would be greatly appreciated!
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
I don't what happen with ur properties file... For my program, which use properties file to configure the database info, I can edit it, even manually...
If u can provide some code snippets, then I guess we can help u more....

Co-author of SCMAD Exam Guide, Author of JMADPlus
Simon Ingram
Ranch Hand

Joined: Nov 30, 2003
Posts: 173
Hi Ko Ko,
Thanks for you answer. When you say you can edit the file manually, do you mean the way I describe, changing the extension to .txt, editing and then changing the extension back to .properties or do you edit the file some other way? In any event you have to open the file. How?
As for a code snippet:
package com.ingasimn;
public void presentResultSet(ResultSet rs) throws SQLException {
// code in here
Logger.getLogger("com.ingasimn").info("exit presentResultSet");
when I run the program, the info message appears on the console, but not the FINER level "exiting" message.
Regards, Simon
Maverick Lasa

Joined: Oct 18, 2003
Posts: 23
hello simon,
properties file is merely a text file. you can edit using
any text editor. you may assign your default text editor
to .properties extension thus you don't have to change the
file extensions in order to open them on text editors.
Simon Ingram
Ranch Hand

Joined: Nov 30, 2003
Posts: 173
I had come to the same conclusion, thanks for the confirmation!
I agree. Here's the link:
subject: Logging
It's not a secret anymore!