Oracle GlassFish Server 3.0.1 Administration Guide

Rotating the Server Log

Logs are rotated automatically based on settings in the file. You can change these settings by using the Administration Console.

ProcedureTo Rotate a Log File Manually

You can rotate the server log file manually by using the rotate-log subcommand in remote mode. The server log in the default location is immediately moved to a time-stamped file and a new server log is created.

Because log rotation is a dynamic operation, you do not need to restart GlassFish Server for changes to take effect.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Rotate a log by using the rotate-log(1) subcommand.

Example 7–5 Rotating a Log File Manually

This example moves the server.log file to yyyy-mm-dd_server.log and creates a new server.log file in the default location.

asadmin> rotate-log
Command rotate-log executed successfuly.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help rotate-log at the command line.