102
102
<p>The following command writes all syslog messages into a file.</p>
103
103
<textarea rows="5" cols="60">Module (load="builtin:omfile")
104
104
*.* action(type="omfile"
106
FileCreateMode="0644"
107
File="/var/log/messages")
106
FileCreateMode="0644"
107
File="/var/log/messages")
112
112
<p><b>Legacy Configuration Directives</b>:</p>
114
<li><strong>$DynaFileCacheSize </strong>(not mandatory, default 10)<br>
115
defines the maximum size of the dynafile cache for <b>this</b>
116
action. Cache size greatly affects performance and should be
117
set so that it matches the actual need. Note that files
118
inside the cache are kept open until either rsyslogd
119
is HUPed or the file is evicted from the cache.<br></li><br>
121
<li><strong>$OMFileZipLevel </strong>0..9 [default 0]<br>
122
if greater 0, turns on gzip compression of the output file. The higher the number, the better the compression, but also the more CPU is required for zipping.<br></li><br>
124
<li><strong>$OMFileFlushInterval </strong>(not mandatory, default will be used)<br>
125
Defines a template to be used for the output. <br></li><br>
127
<li><strong>$OMFileASyncWriting </strong>on/off [default off]<br>
128
if turned on, the files will be written in asynchronous mode via a separate thread. In that case, double buffers will be used so that one buffer can be filled while the other buffer is being written. Note that in order to enable FlushInterval, AsyncWriting must be set to "on". Otherwise, the flush interval will be ignored. Also note that when FlushOnTXEnd is "on" but AsyncWriting is off, output will only be written when the buffer is full. This may take several hours, or even require a rsyslog shutdown. However, a buffer flush can be forced in that case by sending rsyslogd a HUP signal. <br></li><br>
130
<li><strong>$OMFileFlushOnTXEnd </strong>on/off [default on]<br>
131
Omfile has the capability to write output using a buffered writer. Disk writes are only done when the buffer is full. So if an error happens during that write, data is potentially lost. In cases where this is unacceptable, set FlushOnTXEnd to on. Then, data is written at the end of each transaction (for pre-v5 this means after each log message) and the usual error recovery thus can handle write errors without data loss. Note that this option severely reduces the effect of zip compression and should be switched to off for that use case. Note that the default -on- is primarily an aid to preserve the traditional syslogd behaviour.<br></li><br>
133
<li><strong>$OMFileIOBufferSize </strong><size_nbr>, default 4k<br>
134
size of the buffer used to writing output data. The larger the buffer, the potentially better performance is. The default of 4k is quite conservative, it is useful to go up to 64k, and 128K if you used gzip compression (then, even higher sizes may make sense)<br></li><br>
114
<li><strong>$DynaFileCacheSize </strong><br>
115
equivalent to the "dynaFileCacheSize" parameter<br></li><br>
117
<li><strong>$OMFileZipLevel </strong><br>
118
equivalent to the "zipLevel" parameter<br></li><br>
120
<li><strong>$OMFileFlushInterval </strong><br>
121
equivalent to the "flushInterval" parameter<br></li><br>
123
<li><strong>$OMFileASyncWriting </strong><br>
124
equivalent to the "asyncWriting" parameter<br></li><br>
126
<li><strong>$OMFileFlushOnTXEnd </strong><br>
127
equivalent to the "flushOnTXEnd" parameter<br></li><br>
129
<li><strong>$OMFileIOBufferSize </strong><br>
130
equivalent to the "IOBufferSize" parameter<br></li><br>
136
132
<li><strong>$DirOwner </strong><br>
137
Set the file owner for directories newly created. Please note that this setting does not affect the owner of directories already existing. The parameter is a user name, for which the userid is obtained by rsyslogd during startup processing. Interim changes to the user mapping are not detected.<br></li><br>
133
equivalent to the "dirOwner" parameter<br></li><br>
139
135
<li><strong>$DirGroup </strong><br>
140
Set the group for directories newly created. Please note that this setting does not affect the group of directories already existing. The parameter is a group name, for which the groupid is obtained by rsyslogd on during startup processing. Interim changes to the user mapping are not detected.<br></li><br>
136
equivalent to the "dirGroup" parameter<br></li><br>
142
138
<li><strong>$FileOwner </strong><br>
143
Set the file owner for files newly created. Please note that this setting does not affect the owner of files already existing. The parameter is a user name, for which the userid is obtained by rsyslogd during startup processing. Interim changes to the user mapping are not detected.<br></li><br>
139
equivalent to the "fileOwner" parameter<br></li><br>
145
141
<li><strong>$FileGroup </strong><br>
146
Set the group for files newly created. Please note that this setting does not affect the group of files already existing. The parameter is a group name, for which the groupid is obtained by rsyslogd during startup processing. Interim changes to the user mapping are not detected.<br></li><br>
148
<li><strong>$DirCreateMode </strong>[defaul 0700]<br>
149
This is the same as $FileCreateMode, but for directories automatically generated.<br></li><br>
151
<li><strong>$FileCreateMode </strong>[default 0644]<br>
152
The FileCreateMode directive allows to specify the creation mode with which rsyslogd creates new files. If not specified, the value 0644 is used (which retains backward-compatibility with earlier releases). The value given must always be a 4-digit octal number, with the initial digit being zero. <br>Please note that the actual permission depend on rsyslogd's process umask. If in doubt, use "$umask 0000" right at the beginning of the configuration file to remove any restrictions. <br>FileCreateMode may be specified multiple times. If so, it specifies the creation mode for all selector lines that follow until the next $FileCreateMode directive. Order of lines is vitally important.<br></li><br>
154
<li><strong>$FailOnCHOwnFailure </strong>on/off [default on]<br>
155
This option modifies behaviour of file creation. If different owners or groups are specified for new files or directories and rsyslogd fails to set these new owners or groups, it will log an error and NOT write to the file in question if that option is set to "on". If it is set to "off", the error will be ignored and processing continues. Keep in mind, that the files in this case may be (in)accessible by people who should not have permission. The default is "on".<br></li><br>
142
equivalent to the "fileGroup" parameter<br></li><br>
144
<li><strong>$DirCreateMode </strong><br>
145
equivalent to the "dirCreateMode" parameter<br></li><br>
147
<li><strong>$FileCreateMode </strong><br>
148
equivalent to the "fileCreateMode" parameter<br></li><br>
150
<li><strong>$FailOnCHOwnFailure </strong><br>
151
equivalent to the "failOnChOwnFailure" parameter<br></li><br>
157
153
<li><strong>$F$OMFileForceCHOwn </strong><br>
158
force ownership change for all files<br></li><br>
160
<li><strong>$CreateDirs </strong>on/off [default on]<br>
161
create directories on an as-needed basis<br></li><br>
163
<li><strong>$ActionFileEnableSync </strong>on/off [default off]<br>
164
enables file syncing capability of omfile.<br></li><br>
166
<li><strong>$ActionFileDefaultTemplate </strong>[templateName]<br>
167
sets a new default template for file actions.<br></li><br>
154
equivalent to the "ForceChOwn" parameter<br></li><br>
156
<li><strong>$CreateDirs </strong><br>
157
equivalent to the "createDirs" parameter<br></li><br>
159
<li><strong>$ActionFileEnableSync </strong><br>
160
equivalent to the "enableSync" parameter<br></li><br>
162
<li><strong>$ActionFileDefaultTemplate </strong><br>
163
equivalent to the "template" module parameter<br></li><br>
169
165
<li><strong>$ResetConfigVariables </strong><br>
170
Resets all configuration variables to their default value. Any settings made will not be applied to configuration lines following the $ResetConfigVariables. This is a good method to make sure no side-effects exists from previous directives. This directive has no parameters.<br></li><br>
166
Resets all configuration variables to their default value.<br></li><br>