Thursday, 14 December 2017

Logs Rotation


Each WebLogic Server instance writes all messages from its subsystems and applications to a server log file that is located on the local host computer. By default, the server log file is located in the logsdirectory below the server instance root directory; for example, DOMAIN_NAME\servers\SERVER_NAME\logs\SERVER_NAME.log, where DOMAIN_NAME is the name of the directory in which you located the domain and SERVER_NAME is the name of the server.


In addition to writing messages to the server log file, each server instance forwards a subset of its messages to a domain-wide log file.The domain log file provides a central location from which to view the overall status of the domain. The domain log resides in the Administration Server logs directory. The default name and location for the domain log file is DOMAIN_NAME\servers\ADMIN_SERVER_NAME\logs\DOMAIN_NAME.log, where DOMAIN_NAME is the name of the directory in which you located the domain and ADMIN_SERVER_NAME is the name of the Administration Server.




You can rotate log files - 


By size ( default)
By Time




By default, when you start a WebLogic Server instance in development mode, the server automatically renames (rotates) its local server log file as SERVER_NAME.log.n. For the remainder of the server session, log messages accumulate in SERVER_NAME.log until the file grows to a size of 500 kilobytes.
Each time the server log file reaches this size, the server renames the log file and creates a new SERVER_NAME.log to store new messages. By default, the rotated log files are numbered in order of creationfilenamennnnn, where filename is the name configured for the log file. You can configure a server instance to include a time and date stamp in the file name of rotated log files; for example, server-name-%yyyy%-%mm%-%dd%-%hh%-%mm%.log.
By default, when you start a server instance in production mode, the server rotates its server log file whenever the file grows to 5000 kilobytes in size. It does not rotate the local server log file when you start the server.



You can change these default settings for log file rotation. 


For example
you can change the file size at which the server rotates the log file or 
you can configure a server to rotate log files based on a time interval. 
You can also specify the maximum number of rotated files that can accumulate. After the number   of log files reaches this number, subsequent file rotations delete the oldest log file and create a new log file with the latest suffix.


To change log size for rotation or by time -

Login to Administration Console
click on the server
On right hand side click on logging tab
under default selected general tab

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTvLHYi1J24GvttfA-Ynhq4QVymmcmqI2lpBrhK1V6iCqngHm5LWQS3EIzo9MyGrR2S51h1QWJHsj7NyWcIDJPL39j8GNXKZg5AurUa-xFXmg_Pnj1UYtfDjqr1YseCw9k2rXK3PDU0uo/s400/logs+-+2.JPG

Or select By time option under rotation type drop box and enter time in begin rotation time at the you want your server rotate log file

To update for access logs

Login to Administration Console
click on the server
On right hand side click on logging tab
Select HTTP tab and follow the same above instructions.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdF_lmw-XOYnGhb4OENvVDTFpmFbgZGn93uGGv1DF5uyl-Hy8SvFJaeP5owh0U91IU1JijHSG5FVVNkm4v1YFAa-pFlerfm9DzNHgFCgmKVZK67cy31uBOxqQidqul6raAGntu75w8FKs/s400/logs+-+1.1.JPG

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzqqHQdnJj-dvqP_fk-d1C5kINO9OqUWqujA6Q3YJ4rwG7RYfv1exwTq-RqZa4OJzs9lfW1gdKg81o-hB-qiJKVBVUMnBXg-yY3POjF_kOFeIjD7iV8-hFRtSAwh2DmhzGEolR6lbVnJs/s400/logs+-+3.JPG


No comments:

Post a Comment