SunScreen 3.2 Administrator's Overview

Log Retrieval and Clearing

A Screen's log is retrieved and can be cleared using the log subcommand of ssadm. Filtering can be applied by the Screen during retrieval, reducing the content of the log retrieved (see "Log Inspection and Browsing").


Note -

Clearing a Screen's log does NOT free up any disk space. The disk space used by the log, up to the maximum log size, is maintained, to guarantee that there will always be room for the log data. Note also that the disk space used by a log may be slightly more (approximately sixteen megabytes) than the configured log size.


You can retrieve and postprocess logs on an automated basis. ( See the man page for sslogmgmt(1M) for details on automated log management.) sslogmgmt(1M) automates management of SunScreen logs for a group of centrally managed Screens. It can be run manually, as it is designed to run as a cron(1M) job. It is a feature installed by the SUNWsfwau package.

The table below shows the three subcommands for log.

Table 11-2 log Subcommands

Subcommand 

Description 

get

Retrieves the current content of the log, but leaves it intact. 

clear

Makes the current content of the log inaccessible for further retrieval operations. 

get_and_clear

Combines these two functions, clearing the log through the point to which it was retrieved. 

Retrieval (get) of the log produces the (binary) log records on the standard output of ssadm. This can be redirected to a file or perhaps piped into other processes, such as ssadm logdump for viewing, further filtering, and so forth. The output stream from a log get* operation is manipulated with the piping and redirection capabilities of the shell that you are using on your Administration Station.


Note -

The get_and_clear operation clears the log when the Screen producing the log finishes writing to the connection used to retrieve it. If the administration platform crashes, the disk to which the log is being written fills, or other exceptional conditions occur near the end of the retrieval, the clear phase can complete and some log records can be lost.


Examples: get, clear, get_and_clear

The following are examples of working with the get, clear, and get_and_clear commands.

To get the log from a Screen you are logged into (primary or secondary) and store the filtered result in a local file:


admin% ssadm -r Screen log get [filterargs] >local_log_file

See "Log Filters and the logdump Command" for information about filtering.

To simply clear the log:


admin% ssadm -r Screen log clear

To get the log, store the filtered result in a local file, and clear the log:


admin% ssadm -r Screen log get_and_clear [filterargs] >local_log_file

The get_and_clear and clear verbs take an optional argument, -U: a designation of the user who cleared the log. This text string is displayed when log statistics are retrieved.

Here are examples of the get_and_clear and clear commands. To get and clear the log, setting the user designator as "ben":


admin% ssadm -r Screen log -U "ben" get_and_clear [filterargs]>local_file

To clear the log, setting the user designator as "Ben" and commenting that Ben should reset a counter or something after moving a file:


admin% ssadm -r Screen log -U "Ben: reset after move" clear