Menu

Enable logging in Weblogic to print System.out.println()

Weblogic By Mar 12, 2013 5 Comments

I have a web application in which I have given “System.out.println()”
statements to print information, but I could not see these statements in
weblogic logs. To get these print statements in weblogic logs, “stdout” should
be enabled in the weblogic server log. To check this, we can follow the below
procedure.
  • Go to weblogic and select
    the server (Ex: AdminServer) in which you want to enable this logging
  • Go to “Logging” tab of the
    server
  • Click on “Advanced” option
  • Enable or Check in the
    option “Redirect stdout logging enabledif
    it is not checked in
  • And also Check in the
    option “Redirect stderr logging enabledto
    print error statements in the server logs
  • After enabling these
    options, the screen would look as below  


  • Click on Save button and
    Restart the server instance

 

5 Comments

  1. Unknown says:

    Thank for your post. What if there is more than one application that deployed on one server and each on of them has its own log. I do not want mix all applications logs in one place. How to separate them so the log of each application is stored in separate file in sever.

  2. Hi Ahmad,
    Sorry for the late reply.
    You can use the logging tools like log4j to have your own log files.

  3. Anonymous says:

    Hi Anand,

    The above configuration works only if you start the server using node manager. What if the server is started using command prompt?

    Regards,

  4. Hi,
    It should work even if you run the server from command prompt. Open console and do the above steps. Then restart the server in command prompt. Node manager is not mandatory for this.

  5. CEO Kango says:

    I have a deployment that uses log4j. It logs well to a separate log file when I deploy on 11g and on 12c development instance. But when I deploy on a different 12c weblogic prod server , no log file is generated.

Leave a comment

Hi, Welcome here.
JOIN OUR NEWSLETTER
And get notified everytime we publish a new blog post.