Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This will create a new file .n.log (n=1..5) when the size exceeds 20KB. You also can specify 20MB etc. The max value for n ist 13.

Show If
groupsos-developer-team

Deleting old files.

As log4j does not provide deleting of old files (maxBackupIndex does not work for all appenders), you should implement a file deletion job on the master. For each agent, you have do define a seperate job.

Code Block
languagexml
titleDeleting old files
<job  title="Remove temporary files" order="no" tasks="1" process_class="vmubuntu2" name="CleanupLogFiles">
    <description >
        <include  file="jobs/JobSchedulerCleanupFiles.xml"/>
    </description>
    <params >
        <param  name="file_path" value="./logs"/>
        <param  name="file_spec" value="^.*\.log.gz$"/>
        <param  name="file_age" value="00:03"/>
    </params>
    <script  language="java" java_class="sos.scheduler.job.JobSchedulerCleanupFiles"/>
    <run_time >
        <weekdays >
            <day  day="1 2 3 4 5 6 7">
                <period  single_start="23:00"/>
            </day>
        </weekdays>
    </run_time>
</job>

 

 

 

 

 

 

 

Code Block
languagexml
titleDeleting old files