From 502bfd940bfc39fe4eb256d8bd06cc5a15c098d3 Mon Sep 17 00:00:00 2001
From: Laurent Bercot
Date: Sat, 7 Feb 2015 14:51:06 +0000
Subject: - s6-log overhaul (more stack, less heap), with new directives -
related doc update - version: 2.1.1.0 rc
---
doc/s6-log.html | 70 +++++++++++++++++++++++++++++++++++++++++++--------------
1 file changed, 53 insertions(+), 17 deletions(-)
(limited to 'doc/s6-log.html')
diff --git a/doc/s6-log.html b/doc/s6-log.html
index 0a525d6..ae54010 100644
--- a/doc/s6-log.html
+++ b/doc/s6-log.html
@@ -53,9 +53,9 @@ exit when reading EOF on stdin.
-t : timestamp. Prepends every log line that is written to
a logging directory with a
TAI64N
-timestamp.
+timestamp. This option is now deprecated.
-e : timestamp alerts. Prepends every "alert" line with a
-TAI64N timestamp.
+TAI64N timestamp. This option is now deprecated.
-q | -v : quiet | verbose. Decreases | increases s6-log's
verbosity, i.e. which messages are sent to stderr. The default verbosity is 1.
Currently supported verbosity levels:
@@ -220,8 +220,29 @@ an unpadded, unlimited status file. By default, statussize is 1001. execlineb must be found in s6-log's PATH.
If processor is empty, no processor will be set for the next logdirs.
By default, no processor is set.
+ t: the logged line will be prepended with a
+TAI64N
+timestamp (and a space) before being processed by the next action
+directive. Giving the t directive several times before an action
+directive has no effect.
+ T: the selected line will be prepended with a
+ISO 8601
+timestamp for combined date and time representing local time
+according to the system's timezone, with a space (not a 'T')
+between the date and the time and two spaces after the time, before being
+processed by the next action directive. Giving the T directive
+several times before an action directive has no effect.
+
+ Note that unlike the other control directives, the t and
+T directives are not sticky: their effect will
+disappear after the next action directive, and they need to be
+reapplied if necessary. If both a t and a T
+directives are given before an action directive, the TAI64N timestamp
+will always appear before the ISO 8601 timestamp.
+
+
Action directives
@@ -230,9 +251,14 @@ selected lines.
- - e: alert. s6-log will print "s6-log: alert: ",
+
- 2 or e: alert. s6-log will print "s6-log: alert: ",
possibly prepended with a timestamp, followed by the first
-alertsize bytes of the line.
+alertsize bytes of the line, to its standard error.
+The e form is deprecated.
+ - 1: forward to stdout. s6-log will print the selected
+line to its stdout. If any error occurs, e.g. if stdout was a pipe and the
+reading end closed, this directive will be ignored for the rest of
+s6-log's lifetime.
- =statusfile: status. s6-log will atomically
update the statusfile file with the first statussize
bytes of the line, and pad it with newlines. s6-log must have the right
@@ -257,25 +283,26 @@ limit.
Examples
- s6-log -bt n20 s1000000 /var/log/services/stuff
+ s6-log -b n20 s1000000 t /var/log/services/stuff
- Logs all of stdin, prepending every line with a timestamp, into the
+ Logs all of stdin, prepending every line with a TAI64N timestamp, into the
/var/log/services/stuff logdir, with a maximum archive of
20 log files of 1 MB each; makes sure every line has been written
before reading the next one.
- s6-log -t n30 E500 - +fatal: e - +^STAT =/var/log/foobard/status f s10000000 S15000000 !"gzip -nq9" /var/log/foobard
+ s6-log n30 E500 - +fatal: e - +^STAT =/var/log/foobard/status f s10000000 S15000000 T !"gzip -nq9" /var/log/foobard
- Sends alerts to stderr with the 500 first bytes of lines containing "fatal:".
- Maintains the /var/log/foobard/status file at 1001 bytes,
updating it when it finds a log line starting with "STAT".
- - Logs all other lines to logdir /var/log/foobard. When current
+
- Logs all other lines to logdir /var/log/foobard, prepending
+them with an ISO 8601 timestamp. When current
reaches at least 9998 kB (i.e. 10 MB filesise minus 2kB tolerance), pipe it
through gzip -nq9 and save the result into a timestamped archive file, with
a maximum of 30 such files or a total of 15 MB of compressed archive files.
@@ -301,14 +328,15 @@ is overpowered for this. We don't need a complete shell script interpreter:
most processor commands will be very simple, with only two or three
words, and we only need a way to turn a string into an argv, i.e. a
command line.
- - execlineb
+
- execlineb
was designed just for this: to turn simple strings into command lines.
It is a very fast and lightweight script launcher, that does not do any heavy
startup initialization like /bin/sh does. It happens to be the perfect
tool for the job.
- - Yes, I also did this on purpose so people have a reason to use the
-execline language. Do not
-look at me like that: it really is the perfect tool for the job.
+ - To be perfectly honest: I also did this on purpose so people have a
+reason to use the
+execline language. But
+seriously, it really is the perfect tool for the job.
Why have another logging mechanism ?
@@ -318,7 +346,9 @@ look at me like that: it really is the perfect tool for the job.
I'm not being judgmental; I'm just stating the obvious.
- The syslog design is flawed from the start
+
+ The syslog design is flawed from the start
+
When
@@ -381,7 +411,9 @@ serious alternative yet, except maybe
s6-log improves upon.
- A not-so-modest proposal: the logging chain
+
+ A not-so-modest proposal: the logging chain
+
Unix distributions already do this to some extent, but it's at best
@@ -446,7 +478,9 @@ error messages, and maybe process 1's error messages, are sent to the
system console.
- What does s6-log have to do with all this ?
+
+ What does s6-log have to do with all this ?
+
In a logging chain situation, every service must have
@@ -473,8 +507,10 @@ your system's loggers.
- You're wrong about being as powerful as
-syslogd: s6-log does not do remote logging.
+
+ You're wrong about being as powerful as
+syslogd: s6-log does not do remote logging.
+
You mean you want to send, live, every log line
--
cgit v1.2.3