Comments (6)
I certainly missing something, but when using postfix with s6-socklog (using the s6-overlay syslogd addon), I end up having the date duplicated in every log lines. As far as I understood posfix doesn't log any date.
You're not missing anything, indeed there's date duplication. The thing is, the syslog()
function (both in musl and glibc) prepends every log line with an ISO date, and it's not deactivatable or configurable. I had forgotten this, so I had made the syslogd-log
service add a timestamp by default, but it is useless. I have removed the default timestamp in the current git, so you won't have to manually modify S6_LOGGING_SCRIPT
once the next version is released.
Also, is there a way to add a server name in the log line (to be compatible with postfix log parser), to have something like
Aug 26 11:19:05 smtp postfix/postfix-script[25430]: refreshing the Postfix mail system
instead of
Aug 26 11:19:05 postfix/postfix-script[25430]: refreshing the Postfix mail system
Unfortunately, it's not possible. syslog()
is a global service: it's impossible for syslogd to treat logs lines differently depending on what process sends them. With most syslog implementations, it is even impossible for syslogd to identify the process that sent a log line. If postfix sends a line starting with postfix/postfix-script
, syslogd cannot rewrite it into smtp postfix/postfix-script
, unless it prepends every log line with smtp
.
from s6.
Thanks for the explanation.
I think that the hostname is part of the syslog protocol message and is normally received by s6-syslogd
. I just thought that for whatever reason (configuration, simplification, ...), it didn't write it to the log line. It was the only reason I saw for the hostname not appearing in the log line as it appears with other syslogd daemon.
from s6.
So smtp
is your hostname?
It is possible that other implementations of syslogd
are configured by default to prepend their log lines with the hostname, but that would surprise me because apparently the hostname is inserted after the date. The syslog()
protocol definitely does not include the hostname as part of the line. That's weird.
from s6.
Sorry I misread the rfc. I quickly look at socklog code and it just parses pri in non raw mode and forward the remaining of the syslog string.
So it's postfix which is sending the date and the hostname ? I don't understand why it writes correctly the hostname with postfix maillog_file
parameter and not in syslog mode with socklog.
from s6.
Yes, that's what I've been saying. If there's a discrepancy, it's client-side. What you see in the syslogd logs is exactly what the client sent, except for the date.
from s6.
Thanks for your time and valuable explanations !
from s6.
Related Issues (20)
- Exec Stop Functionality in s6 HOT 5
- ExecStartPost equivalent functionality in s6 HOT 2
- readiness notification not working HOT 2
- [Question] transition to s6 based init HOT 3
- A few questions HOT 2
- Philosophy on command line built in help `--help` HOT 2
- Failing to build the latest s6 V2.10.0.0 HOT 1
- Failed to build the latest s6 v2.10.0.0 HOT 1
- s6-svscan shows warning messages on arm32v7/alpine container HOT 1
- [feature] Provide already-built (perhaps statically linked) binaries HOT 3
- Broken link to s6-svperms in overview HOT 1
- s6-svc -d and other signals are not affecting service as expected? HOT 3
- Noob here, I have a couple of questions. HOT 1
- [Feature Request] Add i18n Support HOT 5
- Installation Error HOT 1
- [Question] Disabling service within service itself HOT 5
- s6-log: log retention duration HOT 2
- notifyoncheck does not kill check after localtimeout HOT 1
- A service is not restarted after SIGKILL HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from s6.