Weblogic : Log errors in a specific log file for a managed server

20,250

So here is your answer, finally found the missing piece of the puzzle to very obscure Weblogic Loggin Service architechture.

To get what you want you need to do the following: (1) Read through the following documentation piece http://docs.oracle.com/cd/E21764_01/web.1111/e13739/listening.htm#WLLOG188

(2) Then using weblogic specific Jars, code your own Log4J Appender or Jul Handler

(3) Make sour appender subscribe on the Weblogic Server logger. The server logger of weblogic is just a shell that is being route logging events from deployed applications as well as weblogic internal code - such as when your code blows up and the EJB container logs and error.

(4) Code into your handler whatever logic you want.

I will not provide you my design architechture for this, but I will give you an extra two scents:

Be very careful on how your appender logs events coming from weblogic. Make sure that whatever your Appender does for logging the Weblogic WARNINGs or Weblogic INFOS or Errors does end up creating new logging events to the weblogic server logger, or you will create an infinite recursive loop of logging and posisbly even dead lock the logging framework.

But this is the solution for what you want to do - nothing else with work on the Admin Console - you have to realize the weblogic logging architechture is like a closed rock that wants to swallow all the log events and present yoiu the not so useful console log overview of those log events.

I personally do not like it, I think its obscure, but at least you have a way to plugin your own to code their logging architechture.

Good luck.

Share:
20,250
MTranchant
Author by

MTranchant

AWS SA associate

Updated on July 09, 2022

Comments

  • MTranchant
    MTranchant almost 2 years

    For a given managed server (not a whole weblogic server), I need to copy / reroute all WARNING, ERROR, INCIDENT_ERROR level messages to a log file (that has to have rotation settings). Let's say "server1.err.log". The rest of the messages (level under WARNING) have to be written in a different file, for example, "server1.log".

    How can I do that ? My Weblogic server version is 10.3.6.0. I also asked this question in OTN without successfully getting an acceptable response..

    Thanks in advance