LOG command

The LOG command starts or stops the recording of a session to a disk file. All lines of input and output are recorded.

Note:

Do not confuse the LOG command with the function of the same name which is a mathematical function.

Syntax

LOG EOF | TRACEFILE | SAVE | {[APPEND] file-name}

Parameters

EOF

Stops recording of the session and closes any opened log record file.

TRACEFILE

Specifies that the session information should be directed the Oracle trace file, which is identified by the TRACEFILEUNIT option.

SAVE

Forces Oracle OLAP to update the log file. Lines of input and output are not always written to disk as they are generated. Instead, the lines are stored temporarily then written to disk periodically. LOG SAVE effectively issues the LOG EOF and LOG APPEND file-name commands which ensures that all appropriate lines are written to disk by closing the log file and reopening it. Additional lines of input and output are appended to the file.

APPEND

Specifies that the record of your session should be added to the end of an existing disk file. When you omit this argument, the new output replaces the current contents of the file.

file-name

A text expression that is the name of the file to which session information should be written. Unless the file is in the current directory, you must include the name of the directory object in the name of the file.

Note:

Directory objects are defined in the database, and they control access to directories and file in those directories. You can use a CDA statement to identify and specify a current directory object. Contact your Oracle DBA for access rights to a directory object where your database user name can read and write files.

Usage Notes

Automatic Closing of a Log File

When you use LOG file-name to start recording in a disk file, LOG closes any log record file that is currently open. LOG issues this close even when the new file is not actually opened (as when you specify an invalid file name in the LOG statement).

Examples

Example 10-38 Keeping a Log File

To record your session in a file called session.log, use a statement like the following.

LOG 'session.log'