File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Logging

 
Simon Ingram
Ranch Hand
Posts: 173
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 logging.properties 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 logging.properties file?
Any feedback would be greatly appreciated!
Simon
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....
 
Simon Ingram
Ranch Hand
Posts: 173
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 {
Logger.getLogger("com.ingasimn").entering("EV009","presentResultSet");
// code in here
Logger.getLogger("com.ingasimn").exiting("EV009","presentResultSet");
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
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
mavedrive;
 
Simon Ingram
Ranch Hand
Posts: 173
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maverick,
I had come to the same conclusion, thanks for the confirmation!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic