Skip to content

Commit 8825c50

Browse files
committed
file(): restored the legacy file() source options page and added a warning of its 'deprecation' at multiple places
Signed-off-by: Hofi <hofione@gmail.com>
1 parent 0c1712e commit 8825c50

File tree

8 files changed

+72
-11
lines changed

8 files changed

+72
-11
lines changed

_data/link_aliases.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ adm-src-hypr:
165165
adm-src-macOS:
166166
aliases: [ "darwin-oslog()", "darwin-oslog-stream()" ]
167167

168+
adm-src-file-note:
169+
aliases: [ "read kernel messages" ]
170+
168171
adm-dest-google-bq:
169172
aliases: [ "bigquery()" ]
170173

_data/navigation.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,20 @@ admin-guide-nav:
138138
subnav:
139139
- title: "internal() source options"
140140
url: /admin-guide/060_Sources/010_Internal/000_Internal_options
141-
- title: "file (DEPRECATED)"
141+
- title: "file"
142142
url: /admin-guide/060_Sources/020_File/README
143143
subnav:
144144
- title: "file() source options"
145145
url: /admin-guide/060_Sources/020_File/000_File_source_options
146-
- title: "How file sources are followed"
147-
url: /admin-guide/060_Sources/020_File/001_File_following
148146
- title: "Notes on reading kernel messages"
149-
url: /admin-guide/060_Sources/020_File/002_Notes_on_reading_kernel_messages
147+
url: /admin-guide/060_Sources/020_File/001_Notes_on_reading_kernel_messages
150148
- title: "wildcard-file"
151149
url: /admin-guide/060_Sources/021_Wildcard-file/README
152150
subnav:
153151
- title: "wildcard-file() source options"
154152
url: /admin-guide/060_Sources/021_Wildcard-file/000_Wildcard-file_options
153+
- title: "How file sources are followed"
154+
url: /admin-guide/060_Sources/021_Wildcard-file/001_File_following
155155
- title: "freebsd-audit"
156156
url: /admin-guide/060_Sources/030_Freebsd-audit/README
157157
subnav:
@@ -403,7 +403,7 @@ admin-guide-nav:
403403
url: /admin-guide/070_Destinations/100_Kafka-c/001_Shifting_from_Java_to_C
404404
- title: "Flow control in {{ site.product.short_name }} and the Kafka client"
405405
url: /admin-guide/070_Destinations/100_Kafka-c/002_Flow_control
406-
- title: "Options of the kafka() destination's C implementation"
406+
- title: "Options of the kafka() destination"
407407
url: /admin-guide/070_Destinations/100_Kafka-c/003_Kafka-c_options
408408
- title: "Loggly"
409409
url: /admin-guide/070_Destinations/110_Loggly/README
@@ -689,6 +689,8 @@ admin-guide-nav:
689689
url: /admin-guide/080_Log/030_Filters/005_Filter_functions/011_source
690690
- title: "tags()"
691691
url: /admin-guide/080_Log/030_Filters/005_Filter_functions/012_tags
692+
- title: "blank()"
693+
url: /admin-guide/080_Log/030_Filters/005_Filter_functions/013_blank
692694
- title: "Dropping messages"
693695
url: /admin-guide/080_Log/040_Dropping_messages
694696
- title: "Global options of {{ site.product.short_name }}"

_includes/doc/admin-guide/options/follow-method.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
The default `legacy` mode preserves the pre-4.9 version file follow-mode behavior of {{ site.product.short_name }}, which is based on the value of follow-freq().\
88
The `poll` value forces {{ site.product.short_name }} to poll for file changes at the interval specified by the monitor-freq() option, even if a more efficient method (such as `inotify` or `kqueue`) is available.\
99
If `inotify` is selected and supported by the platform, {{ site.product.short_name }} uses it to detect changes in source files. This is the most efficient and least resource-consuming option available on Linux for regular files.\
10-
The `system` value will use system poll methods (via ivykis) like `port-timer` `port` `dev_poll` `epoll-timerfd` `epoll` `kqueue` `ppoll` `poll` and `uring`. For more information about how to control the system polling methods used, see How content changes are followed in file() and wildcard-file() sources.
10+
The `system` value will use system poll methods (via ivykis) like `port-timer` `port` `dev_poll` `epoll-timerfd` `epoll` `kqueue` `ppoll` `poll` and `uring`.
1111

1212
**NOTE:** Using `inotify` also requires setting monitor-method() to `inotify`.
1313
{: .notice--info}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
![]({{ site.baseurl}}/assets/images/caution.png) **CAUTION:**
2+
Currently, the file() source is maintained for compatibility, but for regular files — especially when using wildcards in the filename — it is recommended to use the wildcard-file() source, as it provides better long-term support and more configuration options. The only real use case for the legacy file() source is when you need to read kernel messages.
3+
{: .notice--warning}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
![]({{ site.baseurl}}/assets/images/caution.png) **CAUTION:** As the follow-freq(), follow-method(), monitor-method(), and the monitor-freq() options could have performance penalty effects, it is important to understand how the file and directory monitoring operates depending on these values. For details, refer to How content changes are followed in file() and wildcard-file() sources.
1+
![]({{ site.baseurl}}/assets/images/caution.png) **CAUTION:**
2+
As the follow-freq(), follow-method(), monitor-method(), and the monitor-freq() options could have performance penalty effects, it is important to understand how the file and directory monitoring operates depending on these values. For details, refer to How content changes are followed in file() and wildcard-file() sources.
23
{: .notice--warning}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: file() source options
3+
id: adm-src-file-opt
4+
description: >-
5+
This section describes the options of the file() source in {{ site.product.short_name }}.
6+
---
7+
8+
{% include doc/admin-guide/warnings/file-source-deprecation-warning.md %}
9+
10+
The file() driver has the following options:
11+
12+
{% include doc/admin-guide/options/default-facility.md %}
13+
14+
{% include doc/admin-guide/options/default-priority.md %}
15+
16+
{% include doc/admin-guide/options/encoding.md %}
17+
18+
{% include doc/admin-guide/options/source-flags.md %}
19+
20+
{% include doc/admin-guide/options/follow-freq.md %}
21+
22+
{% include doc/admin-guide/options/follow-method.md %}
23+
24+
{% include doc/admin-guide/options/hook.md %}
25+
26+
{% include doc/admin-guide/options/keep-timestamp.md %}
27+
28+
{% include doc/admin-guide/options/log-fetch-limit.md %}
29+
30+
{% include doc/admin-guide/options/log-iw-size.md %}
31+
32+
{% include doc/admin-guide/options/log-msg-size.md %}
33+
34+
{% include doc/admin-guide/options/log-prefix.md %}
35+
36+
{% include doc/admin-guide/options/multi-line-garbage.md %}
37+
38+
{% include doc/admin-guide/options/multi-line-mode.md %}
39+
40+
{% include doc/admin-guide/options/multi-line-prefix.md %}
41+
42+
{% include doc/admin-guide/options/multi-line-suffix.md %}
43+
44+
{% include doc/admin-guide/options/multi-line-timeout.md %}
45+
46+
{% include doc/admin-guide/options/pad-size.md %}
47+
48+
{% include doc/admin-guide/options/program-override.md %}
49+
50+
{% include doc/admin-guide/options/tags.md %}
51+
52+
{% include doc/admin-guide/options/time-zone.md %}

doc/_admin-guide/060_Sources/020_File/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ short_title: file
44
id: adm-src-file
55
description: >-
66
Collects log messages from plain-text files, for example, from the logfiles of
7-
an Apache webserver. If you want to use wildcards in the filename, use the [[wildcard-file() source|adm-src-wild]]. Currently, {{ site.product.short_name }} supports the file() source to maintain certain compatibilities, but it is advised to use the wildcard-file() source for longevity reasons and more configuration options.
7+
an Apache webserver.
88
---
99

10+
{% include doc/admin-guide/warnings/file-source-deprecation-warning.md %}
11+
1012
The {{ site.product.short_name }} application notices if a file is renamed or replaced with
1113
a new file, so it can correctly follow the file even if logrotation is
1214
used. When {{ site.product.short_name }} is restarted, it records the position of the last
1315
sent log message in the /var/lib/syslog-ng/syslog-ng.persist file, and
1416
continues to send messages from this position after the restart.
1517

1618
The file driver has a single required parameter specifying the file to
17-
open. If you want to use wildcards in the filename, use the [[wildcard-file() source|adm-src-wild]].
19+
open. If you want to use wildcards in the filename, use the wildcard-file() source.
1820
For the list of available optional parameters, see file() source options.
1921

2022
{% include doc/admin-guide/warnings/file-source-follow-warning.md %}
@@ -49,5 +51,3 @@ treats messages received from files as sent by the kern facility. Use
4951
the **default-facility()** and **default-priority()** options in the
5052
source definition to assign a different facility if needed.
5153
{: .notice--info}
52-
53-
For the configuration options available in the `file()` source, see wildcard-file() source options.

0 commit comments

Comments
 (0)