Question

I have a weblogic server (10.3.5). I have configured a new logger/log_handler, no problem.

I now want to change, on this log_handler, the way the log are written. For the moment, it is written this way :

[2013-07-29T09:41:16.653+00:00] [MS_server1] [NOTIFICATION] [] [myCustomLogger] [tid: [ACTIVE].ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: Anonymous] [ecid: 3928459900541890,0:1:1:1] [APP: myfrontend-1] [URI: /FO/app/pages/feedback] My loggued message.

I need to remove all the part weblogic automatically add to finally get :

My loggued message.

My logging.xml contains :

<log_handler name='myCustomLLog-handler' class='oracle.core.ojdl.logging.ODLHandlerFactory' filter='oracle.dfw.incident.IncidentDetectionLogFilter'>
   <property name='path' value='${domain.home}/servers/${weblogic.Name}/logs/${weblogic.Name}-myCustomLog.log'/>
   <property name='maxFileSize' value='10485760'/>
   <property name='maxLogSize' value='104857600'/>
   <property name='encoding' value='UTF-8'/>
   <property name='useThreadName' value='true'/>
   <property name='supplementalAttributes' value='J2EE_APP.name,J2EE_MODULE.name,WEBSERVICE.name,WEBSERVICE_PORT.name,composite_instance_id,component_instance_id,composite_name,component_name'/>
</log_handler>

How can I do that ?

Thanks !

Was it helpful?

Solution

I asked the same question to Oracle teams, they said it is not possible, except by using log4j logger.

Quotting BeeAarKay :

To my knowledge, you can't change WebLogic Server's own Log Message Format (any ways the support requires informations in case of a problem).

But you can configure WebLogic to use Log4j (please review the URL :: http://docs.oracle.com/cd/E13222_01/wls/docs103/logging/config_logs.html#wp1014610 for "How to Use Log4j with WebLogic Logging Services") and, when Log4j is enabled, you can get a reference to the org.apache.log4j.Logger that the server is using and attach your own appender.

When Log4j is enabled, you get a reference to the org.apache.log4j.Logger that the server is using from the weblogic.logging.log4j.Log4jLoggingHelper class.

With a Log4j Logger reference, `you can attach you own custom appender to receive the server log events; for example, you might attach an appender that sends the server log events to Syslog or the Windows Event Viewer. Additionally, you can use the Logger reference to issue log requests to WebLogic logging services; this requires that the Log4j libraries be available to your deployed application.

But this is not a replacement of WebLogic's own log.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top