1

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

user2098512
  • 999
  • 1
  • 7
  • 8

3 Answers3

1

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]

MartinMlima
  • 1,736
  • 1
  • 12
  • 13
  • I am trying to control the file size by making the logger level as INFO on weblogic console,But it doesnt seem to get reflected on the files.@MartinMlima any idea on how to set log levels for the out files. – Krithika Vittal Nov 11 '20 at 02:45
0

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

wilx
  • 17,697
  • 6
  • 59
  • 114
Anandraj
  • 31
  • 3
0

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

Andre Gelinas
  • 912
  • 1
  • 8
  • 10
  • I tried setting this JVM arg as well as checking the two boxes in the Admin console under Logging for redirecting StdOut and StrErr (in 10.3.5 specifically). When I restarted the managed server, the server.out file still gets written to. It seems like now logs go to the server log AND the server.out file now. Is this anyone else's experience? – David Hergert May 06 '15 at 05:48