Skip to content

Commit 352099f

Browse files
authored
Merge pull request syslog-ng#5030 from HofiOne/allow-usage-of-current-config-version-as-default
cfg: Allow usage of `current` in config @Version by default if it is not presented
2 parents daa41d4 + 04f6b15 commit 352099f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/cfg.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -693,9 +693,10 @@ cfg_read_config(GlobalConfig *self, const gchar *fname, gchar *preprocess_into)
693693

694694
if (self->user_version == 0)
695695
{
696-
msg_error("ERROR: configuration files without a version number have become unsupported in " VERSION_3_13
697-
", please specify a version number using @version as the first line in the configuration file");
698-
return FALSE;
696+
msg_warning("WARNING: no version information provided in the configuration file. Please specify `current` "
697+
"to use the latest version and silence this warning, or specify a specific version number using "
698+
"@version as the first line in the configuration file.");
699+
cfg_set_current_version(self);
699700
}
700701

701702
if (res)

news/other-5030.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
`cfg`: allow usage of `current` in config @version by default if it is not presented
2+
3+
This change allows syslog-ng to start even if the `@version` information is not present in the configuration file and treats the version as the latest in that case.
4+
5+
**NOTE:** syslog-ng will still raise a warning if `@version` is not present. Please use `@version: current` to confirm the intention of always using the latest version and silence the warning.

0 commit comments

Comments
 (0)