Dave,

You can find documentation on LogMaint at the HTTP Server for i (Powered by Apache) directive finder:
https://www.ibm.com/docs/en/i/7.5?topic=ssw_ibm_i_75/rzas1/rzas1directivefinder.htm

Because Apache for i documentation is hard to navigate, we wrote a blog post with links:
https://www.seidengroup.com/2022/07/23/apache-for-ibm-i-where-to-find-documentation

Here is what the directive finder says about LogMaint, including an example of size_limit:
LogMaint

Module <https://www.ibm.com/docs/api/v1/content/ssw_ibm_i_75/rzaie/rzaiedirective-dict.htm#rzaiedirective-dict__Module>: core
Syntax <https://www.ibm.com/docs/api/v1/content/ssw_ibm_i_75/rzaie/rzaiedirective-dict.htm#rzaiedirective-dict__Syntax>: LogMaint path_to_file expire size_limit
Default <https://www.ibm.com/docs/api/v1/content/ssw_ibm_i_75/rzaie/rzaiedirective-dict.htm#rzaiedirective-dict__Default>: none
Context <https://www.ibm.com/docs/api/v1/content/ssw_ibm_i_75/rzaie/rzaiedirective-dict.htm#rzaiedirective-dict__Context>: server config, virtual host
Override <https://www.ibm.com/docs/api/v1/content/ssw_ibm_i_75/rzaie/rzaiedirective-dict.htm#rzaiedirective-dict__Override>: none
Origin <https://www.ibm.com/docs/api/v1/content/ssw_ibm_i_75/rzaie/rzaiedirective-dict.htm#rzaiedirective-dict__Origin>: IBM
Example <https://www.ibm.com/docs/api/v1/content/ssw_ibm_i_75/rzaie/rzaiedirective-dict.htm#rzaiedirective-dict__Example>: LogMaint logs/access_log 10 2000000
Note: If this directive is not present, log maintenance is not performed. If the directive is present, all parameters are required. Values of 0 for expire and size_limit have a special meaning of no limit. If a LogMaint directive with values of 0 for both expire and size_limits specified, no log maintenance will be done on the specified file.
The LogMaint directive allows you perform log maintenance on the specified file and its derivatives. When log maintenance is performed on a file, it is purged from the system. Derivatives consist of either the path_to_file name provided, concatenated with the extension ".Qcyymmdd", or "Qcyymmdd" if the provided path_to_file value was a directory. LogCycle must be active in order to enable derivatives.

A separate LogMaint directive is required in the server configuration for each CustomLog or ErrorLog that requires log maintenance. The recommended way to configure maintenance is to match the path configured on the LogMaint directive with the path specified on the associated CustomLog or ErrorLog directive.

Parameter One: path_to_file
The path_to_file value specifies the IFS-style path (for example, /QSYS.LIB/MYHTTP.LIB/MYLOGS.FILE) of the log file to be included in log maintenance. Refer to theLogCycle <https://www.ibm.com/docs/api/v1/content/ssw_ibm_i_75/rzaie/rzaiemod_core.htm#logcycle> directive for more information on log file names and extensions.
Parameter Two: expire
The expire value specifies an integer value indicating the number of days before a log file expires. Files older than this value are to be removed. A value of 0 means the log file will never expire. The age of the error log file is determined by the file creation date (as reported by the operating system). The file name suffix, such as errorlog.Q100082213, is not used to determine the age of the file. Files that are currently open and active in the server instance will not be removed.
Parameter Three: size_limit
The size_limit value specifies an integer value indicating the maximum aggregate size of log files with the name path_to_file. When the combined size of the log files exceeds this value in bytes, files are deleted starting with the oldest file. Eligible files are deleted until the collective size is less than or equal to the value specified on this directive. A value of 0 means there is no size limit. Note that it is possible for the aggregate size of log files to exceed the total size_limit. This is possible due to the fact that the size of any open log files are not included in the size_limit total. Users should take this into account when they are calculating a value for size limit, and when setting a maximum value for the LogLength directive.
If both expire and size_limit are configured to non-zero values, the expired files are purged first. If the size_limits still exceeded after expired files are purged, the server continues purging files (oldest files first) until the collective log size is equal to or less than the size_limit.

Note: If invalid values are used for expire or size_limit, an error message will be placed into the job log and the HTTP Server will not start.
The following example of log maintenance will be performed on the logs/access_log file and its derivatives (see below for details). The files will expire after 10 days. In addition, if the total limit exceeds 2,000,000 bytes, log maintenance will be performed.

LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/access_log common
LogMaint logs/access_log 10 2000000
The following example of log maintenance will be performed on the /QSYS.LIB/MYHTTP.LIB/MYLOGS.FILE/Q* files. The files will expire after 25 days and there is no total limit on the size of the files.

LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog /QSYS.LIB/MYHTTP.LIB/MYLOGS.FILE common
LogMaint /QSYS.LIB/MYHTTP.LIB/MYLOGS.FILE 25 0
Only one occurrence of this directive can exist per server or virtual host container. If the directive occurs more than once, the last one specified in the server or virtual host is used.

Note: If LogCycle is configured to Off, then log maintenance is not performed.


Thanks,
Alan



Alan Seiden
Principal, Seiden Group
APIs, Modernization, and Open Source on IBM i
CommunityPlus+ PHP with SmartSupport





Free tips on IBM i and open source: http://www.seidengroup.com/tips

Office: 201-447-2437 Cell: 201-248-4704
http://www.seidengroup.com | alan@xxxxxxxxxxxxxxx
http://twitter.com/alanseiden

On Oct 11, 2023, at 3:02 AM, Dave <dfx1@xxxxxxxxxxxxxx> wrote:

Hi,

A couple of questions on this directive:
LogMaint logs/access_log 7 0

Can I use the size parameter only of the LogMaint directive? Why can't I
find this in the directive index at apache.org?

Thanks
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.