Posts Tagged ‘java’

Loggers may be assigned levels. The set of possible levels, that is DEBUG, INFO, WARN, ERROR and FATAL are defined in the org.apache.log4j.Level class.
If a given logger is not assigned a level, then it inherits one from its closest ancestor with an assigned level.

The root logger resides at the top of the logger hierarchy. It always exists and always has an assigned level.

The logger is the core component of the logging process. In log4j, there are 5 normal levels Levels of logger available (not including custom Levels), the following is borrowed from the log4j API (http://jakarta.apache.org/log4j/docs/api/index.html):
DEBUG – The DEBUG Level designates fine-grained informational events that are most useful to debug an application.
INFO – The INFO level designates informational messages that highlight the progress of the application at coarse-grained level.
WARN – The WARN level designates potentially harmful situations.
ERROR – The ERROR level designates error events that might still allow the application to continue running.

TRACE – The TRACE Level designates finer-grained informational events than the DEBUG
FATAL – The FATAL level designates very severe error events that will presumably lead the application to abort.
In addition, there are two special levels of logging available: (descriptions borrowed from the log4j API http://jakarta.apache.org/log4j/docs/api/index.html):
ALL -The ALL Level has the lowest possible rank and is intended to turn on all logging.
OFF – The OFF Level has the highest possible rank and is intended to turn off logging.



Read Full Post »

File Path in Java

When open a file using Java, the absolute file path is different on various OS.

On Linux:


On Windows:

C:/windows/…/sample.xml  (it’s /  not \ neither \\)

On Mac OS:

I don’t eat Apple.


Relative file path is also allowed.

Read Full Post »