Reputation: 3738
The Logger was used in internal jars, I saw in some Weblogic docs that it is possible to view Log4j logger output.
How to view the import java.util.logging.Logger output?
I done what mentioned in http://docs.oracle.com/cd/E21764_01/web.1111/e13739/logging_services.htm#WLLOG199
I created logger.properties and run the -Djava command but I still not able to view Logger logs.
# Specify the handlers to create in the root logger
handlers = weblogic.logging.ServerLoggingHandler
# Register handlers for the com.foo.toyshop and its child loggers
com.foo.toyshop.handlers = java.util.logging.ConsoleHandler, weblogic.logging.ServerLoggingHandler
# Do not send the toyshop log messages to the root handler
com.foo.toyshop.useParentHandlers = false
# Set the default logging level for the root logger
.level = ALL
# Set the default logging level for new ConsoleHandler instances
java.util.logging.ConsoleHandler.level = INFO
# Set the default logging level for new FileHandler instances
weblogic.logging.ServerLoggingHandler.level = ALL
[update]
For some reason I can only see the Logger output in the WL process prints (./startWL.sh) and not in the log
Upvotes: 2
Views: 4626
Reputation: 7345
If you are working with Log4j or Commons Logging, Weblogic supports both and it's explained here: Log4j and the Commons Logging API
In the same guide you could find the steps needed to work with logging and Weblogic:
The following steps summarize how you configure and filter log messages that WebLogic Server generates. Related documentation and later sections in this guide describe these steps in more detail.
Use the Administration Console to manage log files and configure the following logging options:
Domain and server log file name and location, rotation pattern, location of archived log files, and number of log files stored. See "View and configure logs" in the Oracle WebLogic Server Administration Console Help.
Types of messages that the server sends to standard out. See "Specify messages for standard out" in the Oracle WebLogic Server Administration Console Help.
Which messages a server instance sends to the domain log. See "Forward messages to the domain log" in the Oracle WebLogic Server Administration Console Help.
Log files for HTTP requests. See "Enable and configure HTTP logs" in the Oracle WebLogic Server Administration Console Help.
Specify the logging implementation (Java Logging or Log4j). See How to Use Log4j with WebLogic Logging Services.
Specify message destination and configure filtering log messages by severity level or other criteria. See "Filter log messages" in the Oracle WebLogic Server Administration Console Help. See also Specifying Severity Level for Loggers.
Alternatively, configure log message filtering on the message handler using the WebLogic Scripting Tool. See "Configuring Existing Domains" in Oracle WebLogic Scripting Tool.
Filter log messages published by the logger using the Java APIs. See Filtering Messages by Severity Level or Other Criteria.
Upvotes: 3