Skip to content

Commit babde02

Browse files
authored
Merge branch 'master' into master
2 parents 6984c49 + c886b24 commit babde02

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

metalog.conf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ maxsize = 1048576 # size in bytes (1048576 = 1 megabyte)
44
maxtime = 86400 # time in seconds (86400 = 1 day)
55
maxfiles = 5 # num files per directory
66

7+
# Format of the timestamp: YYYY-MM-DD HH:MM:SS.NNN
8+
#stamp_fmt = "%F %T.%3N"
9+
10+
# Configures a remote log server
11+
#remote_host = 192.168.1.2
12+
#remote_port = 514
13+
14+
# Send all logs via UDP to a remote log server
15+
#remote_log = 1
16+
717
# This will capture all of the internal log messages that metalog itself
818
# generates. If you use any "command" options below, you will want this
919
# as metalog generates a lot of status messages whenever it executes a
@@ -52,6 +62,8 @@ Kernel messages :
5262
facility = "kern"
5363
logdir = "/var/log/kernel"
5464
break = 1
65+
# Additionally send this log entries via UDP to a remote log server
66+
# remote_log = 1
5567

5668
Crond :
5769

src/metalog.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,8 @@ static int log_line(LogLineType loglinetype, char *buf)
13091309
static int log_udp(char *buf, int bsize)
13101310
{
13111311
buf[bsize] = '\0';
1312+
if (write(1, buf, strlen(buf)) != (ssize_t) strlen(buf))
1313+
return -1;
13121314

13131315
return log_line(LOGLINETYPE_SYSLOG, buf);
13141316
}

0 commit comments

Comments
 (0)