Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Junos CLI Reference
Table of Contents Expand all
list Table of Contents

file (System Logging)

date_range 05-Mar-25

Syntax

content_copy zoom_out_map
file filename {
    facility severity;
    allow-duplicates;
    archive {
        archive-sites {
            url  <password password>;
        }
        (binary-data | no-binary-data);
        files number;
        size size;
        start-time;
        transfer-interval;
        (no-world-readable | world-readable);
    }
    explicit-priority;
    match "regular-expression";
    match-strings string-name;
    structured-data {
        brief;
    }
}

Hierarchy Level

content_copy zoom_out_map
[edit system syslog]

Description

Configure the logging of system messages to a file.

Starting in Junos OS Release 20.3R1, the change-log is a default option at [edit system syslog file name] hierarchy for SRX Series Firewalls. As the default option, change-log records all the configuration changes. In Junos OS releases earlier than 20.2R1, you need to configure change-log.

Options

facility—Class of messages to log. To specify multiple classes, include multiple facility severity statements. For a list of the facilities, see Junos OS System Logging Facilities.

severity—Severity of the messages that belong to the facility specified by the paired facility name. Messages with severities of the specified level and higher are logged. For a list of the severities, see System Log Message Severity Levels.

file filename—File in the /var/log directory in which to log messages from the specified facility. To log messages to more than one file, include more than one file statement.

allow-duplicates—Do not suppress the repeated messages.

archive—Specify the archive file information.

  • archive-sites—Specify a list of destination URLs for the archived log files.

    • url—Specify the primary and failover URLs to receive archive files.

  • binary-data—Mark file such that it contains binary data.

  • no-binary-data—Do not mark the file such that it contains binary data.

  • files—Specify the number of files to be archived. Range: 1 through 1000 files.

  • size—Specify the size of files to be archived. Range: 65,536 through 1,073,741,824 bytes.

  • world-readable—Allow any user to read the log file.

  • no-world-readable—Do not allow any user to read the log file.

  • start-time—Specify the start time for file transmission. Enter the start time in the yyyy-mm-dd.hh:mm format.

  • transfer-interval—Specify the frequency at which to transfer the files to archive sites.

explicit-priority—Include the priority and facility in messages.

match—Specify the regular expression for lines to be logged.

structured-data—Log the messages in structured log format.

  • brief—Omit English language text from the end of the logged message.

The remaining statements are explained separately. See CLI Explorer.

Required Privilege Level

system—To view this statement in the configuration.

system-control—To add this statement to the configuration.

Release Information

Statement introduced before Junos OS Release 7.4.

footer-navigation