Tagged Questions
55
votes
7answers
20k views
Java Logging vs Log4J
is it still worth to add the log4j library to a Java 5 project just to log
let's say some exceptions to a file with some nice rollover settings.
Or will the standard util.logging facility do the job ...
24
votes
5answers
20k views
How can I disable the default console handler, while using the java logging API?
Hi I am trying to implement the java logging in my application. I want to use two handlers.
A file handler and my own console handler. Both of my handlers work fine. My logging is send to a file and ...
14
votes
2answers
24k views
How to get java Logger output to file by default [duplicate]
Netbeans thoughtfully sprinkles Logger.getLogger(this.getClass().getName()).log(Level. [...]
statements into catch blocks. Now I would like to point them all to a file (and to console).
Every logging ...
12
votes
6answers
17k views
Good examples using java.util.logging
I want use logs in my program, and I heard about java.util.logging, but I dont know how to begin.
Can show me examples what can I do with the logging?
10
votes
2answers
5k views
Why are my Level.FINE logging messages not showing?
The JavaDocs for java.util.logging.Level state:
The levels in descending order are:
SEVERE (highest value)
WARNING
INFO
CONFIG
FINE
FINER
FINEST (lowest value)
Source
import ...
9
votes
4answers
117 views
How to get a Logger for a subclass?
I have a subclass and a superclass. In the superclass I have a method that logs something. When I create an instance of the subclass the logger creates a logging message for the super class. Why is ...
8
votes
4answers
12k views
Load java.util.logging.config.file for default initialization
I'm trying to load a custom log.properties file when my application is started.
My properties file is in the same package as my main class, so I assumed that the ...
6
votes
3answers
7k views
Where does java.util.logging.Logger store their log
This might be a stupid question but I am a bit lost with java Logger
private static Logger logger = Logger.getLogger("order.web.OrderManager");
logger.info("Removed order " + id + ".");
...
6
votes
1answer
1k views
What is the difference between log4j and java.util.logging
Which is best for getting the log files of user logged in his account? Explain with a small example... Thanks for your time...
6
votes
2answers
1k views
What is the most modern way to log to syslog using a java.util.logging handler?
I am specifically looking for the most up to date, modern SysLogHandler for java.util.logging.
I have found a few that date back to 2001 - 2003, mostly un-supported now.
I know that syslog is a ...
5
votes
4answers
7k views
java.util.logging: how to suppress date line
I'm trying to suppress output of the date line durinng logging when using the default logger in java.util.logging. For example, here is a typical output:
Jun 1, 2010 10:18:12 AM ...
5
votes
5answers
1k views
Managing a Large Number of Log Files Distributed Over Many Machines
We have started using a third party platform (GigaSpaces) that helps us with distributed computing. One of the major problems we are trying to solve now is how to manage our log files in this ...
5
votes
1answer
905 views
Java log in plain text
I redirected Java Logger to log in file using following code:
Handler handler = new FileHandler("test.log", LOG_SIZE, LOG_ROTATION_COUNT);
Logger.getLogger("").addHandler(handler);
but it logs in ...
5
votes
1answer
3k views
Why would you use logging.properties if App Engine automatically logs stdout & stderr to INFO & WARNING?
According to the documentation for Google App Engine for Java:
The App Engine Java SDK includes a
template logging.properties file, in
the appengine-java-sdk/config/user/
directory. To use ...
5
votes
3answers
346 views
How to add custom log handler to Google App Engine?
I am trying to add a custom log handler to my java application. I have implemented a InnerLogger class that extends java.util.Logging.Handler class. And in my logging.properties declared as a handler:
...