how to prevent the stdout.out in weblogic to increasing the size heavily (Windows)

9.9k views Asked by At

I have deployed a system integrated with weblogic, but until now I faced a problem is the weblogic increasing the stdout.out size heavily(by GB per week), it caused the system to load slowly and slowly.

Any way to prevent it increase the size heavily or redirect into .log?

Thanks alot

3

There are 3 answers

0
Anandraj On

Weblogic provides features of log files rotation based on the size and time interval.

You can try rotating the log files based on the size. You would need to configure the log rotation policy from the admin console. Please refer the below link for further details.

http://docs.oracle.com/cd/E12840_01/wls/docs103/ConsoleHelp/taskhelp/logging/RotateLogFiles.html

If you want to rotate the log files on demand, you can use the below WSLT script.

C:\>java weblogic.WLST
#connect WLST to an Administration Server
wls:/offline> connect('username','password')
#navigate to the ServerRuntime MBean hierarchy
wls:/mydomain/serverConfig> serverRuntime()
wls:/mydomain/serverRuntime>ls()
#navigate to the server LogRuntimeMBean
wls:/mydomain/serverRuntime> cd('LogRuntime/myserver')
wls:/mydomain/serverRuntime/LogRuntime/myserver> ls()
-r--   Name                                         myserver
-r--   Type                                         LogRuntime
-r-x   forceLogRotation                             java.lang.Void :
#force the immediate rotation of the server log file
wls:/mydomain/serverRuntime/LogRuntime/myserver> cmo.forceLogRotation()
wls:/mydomain/serverRuntime/LogRuntime/myserver>

http://docs.oracle.com/cd/E12840_01/wls/docs103/logging/config_logs.html#wp1001654

1
MartinMlima On

As David Herget says above, using the WebLogic Scripting Tool (WLST) to redirect StdOut and StdErr did not actually work for me either; I had to also do so through the web console (even though they appear to be set on the console) and restart the relevant jvms.

I can't reply to David's comment above due to being a newbie. [Edited since for clarity]

1
Andre Gelinas On

Not totally sure to understand fully your question.

Are you talking about the {server_name}.out file located in the {Domain_Path}/servers/{server_name}/logs ?

If so, I've never found anyway to rotate those logs automatically so I run a script each day to rotate it (basically copying it to another name, zip it and echoing a NULL in the orginal file...erasing the older one after).

If you are talking about redirecting StdOut to the logs though, that can be done within the console for each server in the logging tab by checking "Redirect stdout logging enabled". Configuration to rotate those logs can also be done within that tab.

On that, StdErr can also be redirected, but not from the console (in WL9). You have to put "RedirectStderrToServerLogEnabled" at true in the MBean tree by wlst (it's located at /Servers/{server_name}/Log/{server_name}

I know the question was ask long time ago but hoping it would help nonetheless