Accessing and configuring JViews logging traces

Article ID: 2277
Last updated: 29 May, 2018
Article ID: 2277
Last updated: 29 May, 2018
Revision: 3
Views: 751
Posted: 03 Mar, 2012
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

Can I access and configure the logging traces logged by JViews?

Answer

Yes, you can access and configure them. See details below.

Access

Yes. You can have access to all logs issued by JViews by creating a logger for the ilog.views package. Like this:

java.util.logging.Logger logger = java.util.logging.Logger.getLogger("ilog.views");

Configuration

  1. Programmatically

    You can customize the Logger class programmatically using the java.util.logging.Logger as illustrated below:.

    java.util.logging.Logger logger =

    java.util.logging.Logger.getLogger("ilog.views");

    logger.setLevel(java.util.logging.Level.SEVERE);

  2. File

    You can also customize the logging properties of your application via a logging properties file. You can specify the logging level for the ilog.views logger. It could be similar to this:

    ilog.views.level=SEVERE

    The valid logging levels are: ALL, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST and OFF, as defined in the

    java.util.logging.Level.

    Besides configuring the logger, your configuration file provides you with the ability to configure other aspects of the logging facility such as: global logging level, the log handler class, log handler specific properties, and so on.

    In order to enforce the use of your logging configuration file you need to specify its absolute path and name in the java.util.logging.config.file system property.

    For example:

    java -Djava.util.logging.config.file=c:my-projectsjviewssample_logging.properties MyApplication

    If you do not specify the absolute path, the logging properties file will be searched under its default location which is inside the JDK, under JAVA_HOME/jre/lib/logging.properties. In which case you would need to change this file in order to have any logging changes take effect.

Note: Logging is only supported on JDK 1.4 and later.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2277
Last updated: 29 May, 2018
Revision: 3
Views: 751
Posted: 03 Mar, 2012 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Also read

Also listed in


Others in this category