use instance-name for syslog?
Hello,
When running multiple instances of dovecot on the same host (or running multiple docker container), it is hard to distinguish logs from different processes: the syslog entries are all prefixed with the same identifier "dovecot" It is hardcoded here: https://github.com/dovecot/core/blob/master/src/lib-master/master-service.c#...
Would it make sense to use the already implemented instance-name as syslog ident? How do others solve that problem?
Andreas
Hi!
On Thu, 31 May 2018 00:44:58 +0900, A. Schulze wrote:
When running multiple instances of dovecot on the same host (or running multiple docker container), it is hard to distinguish logs from different processes: the syslog entries are all prefixed with the same identifier "dovecot" It is hardcoded here: https://github.com/dovecot/core/blob/master/src/lib-master/master-service.c#...
Would it make sense to use the already implemented instance-name as syslog ident? How do others solve that problem?
I have a patchset to implement that. Please see the attachment.
-- -- Name: SATOH Fumiyasu @ OSS Technology Corp. (fumiyas @ osstech co jp) -- Business Home: https://www.OSSTech.co.jp/ -- GitHub Home: https://GitHub.com/fumiyas/ -- PGP Fingerprint: BBE1 A1C9 525A 292E 6729 CDEC ADC2 9DCA 5E1C CBCA
Am 30.05.2018 um 18:08 schrieb SATOH Fumiyasu:
Hi!
On Thu, 31 May 2018 00:44:58 +0900, A. Schulze wrote:
When running multiple instances of dovecot on the same host (or running multiple docker container), it is hard to distinguish logs from different processes: the syslog entries are all prefixed with the same identifier "dovecot" It is hardcoded here: https://github.com/dovecot/core/blob/master/src/lib-master/master-service.c#...
Would it make sense to use the already implemented instance-name as syslog ident? How do others solve that problem?
I have a patchset to implement that. Please see the attachment.
Thanks!, I'll try to apply the patch on 2.2.36 and report my results...
Andreas
Am 30.05.2018 um 21:21 schrieb A. Schulze:
Am 30.05.2018 um 18:08 schrieb SATOH Fumiyasu:
I have a patchset to implement that. Please see the attachment.
Thanks!, I'll try to apply the patch on 2.2.36 and report my results...
done && looks good.
It's a matter of flavor if the processes should be contain the string with "dovecot" so I skipped the first patch "Do not prepend "dovecot-" to a process name"
now I could set:
no instance_name -> everything as usual
instance_name = foo -> syslog entries start with "foo: ..." -> child processes are named "dovecot-foo/..."
instance_name = dovecot/foo -> syslog entries start with "dovecot/foo: ..." -> child processes are named "dovecot/foo/..." (same if I replace / with - or +)
instance_name = bar/foo -> syslog entries start with "bar/foo: ..." -> child prosesses are named "dovecot-bar/foo/..."
I would love to see that feature upstream one day.
Thanks, Andreas
A. Schulze skrev den 2018-05-31 15:56:
I would love to see that feature upstream one day.
i like to see dovecot maillist stops breaking dkim
and stable opendkim, openarc, opendmarc
but its more simply to play lotto for me to win :=)
On 30 May 2018, at 19.08, SATOH Fumiyasu fumiyas@osstech.co.jp wrote:
Hi!
On Thu, 31 May 2018 00:44:58 +0900, A. Schulze wrote:
When running multiple instances of dovecot on the same host (or running multiple docker container), it is hard to distinguish logs from different processes: the syslog entries are all prefixed with the same identifier "dovecot" It is hardcoded here: https://github.com/dovecot/core/blob/master/src/lib-master/master-service.c#...
Would it make sense to use the already implemented instance-name as syslog ident? How do others solve that problem?
I have a patchset to implement that. Please see the attachment.
Subject: [PATCH 1/2] master: Do not prepend "dovecot-" to a process name
Why not? I'd think it would be useful to always find dovecot processes.
- openlog(ident, options, facility);
- static char *syslog_ident = NULL;
- i_free(syslog_ident);
- syslog_ident = i_strdup(ident);
- openlog(syslog_ident, options, facility);
I don't think this is necessary?
env_put(t_strconcat("INSTANCE_NAME=", set->instance_name, NULL));
Also not needed.
But yeah, I guess in general it would make sense to use instance_name for syslog ident.
Am 31.05.2018 um 20:40 schrieb Timo Sirainen:
On 30 May 2018, at 19.08, SATOH Fumiyasu fumiyas@osstech.co.jp wrote: I have a patchset to implement that. Please see the attachment. Subject: [PATCH 1/2] master: Do not prepend "dovecot-" to a process name
Why not? I'd think it would be useful to always find dovecot processes.
for exactly that reason I also skipped that part of the patch
- openlog(ident, options, facility);
- static char *syslog_ident = NULL;
- i_free(syslog_ident);
- syslog_ident = i_strdup(ident);
- openlog(syslog_ident, options, facility);
I don't think this is necessary?
env_put(t_strconcat("INSTANCE_NAME=", set->instance_name, NULL));
Also not needed.
But yeah, I guess in general it would make sense to use instance_name for syslog ident.
I'm pretty sure you could tweak the patch. Good to see, you agree in general.
Andreas
On Fri, 01 Jun 2018 03:40:07 +0900, Timo Sirainen wrote:
When running multiple instances of dovecot on the same host (or running multiple docker container), it is hard to distinguish logs from different processes: the syslog entries are all prefixed with the same identifier "dovecot" It is hardcoded here: https://github.com/dovecot/core/blob/master/src/lib-master/master-service.c#...
Would it make sense to use the already implemented instance-name as syslog ident? How do others solve that problem?
I have a patchset to implement that. Please see the attachment.
Subject: [PATCH 1/2] master: Do not prepend "dovecot-" to a process name
Why not? I'd think it would be useful to always find dovecot processes.
I want to use 'director/*' names, not 'dovecot-director/*' for short name.
- openlog(ident, options, facility);
- static char *syslog_ident = NULL;
- i_free(syslog_ident);
- syslog_ident = i_strdup(ident);
- openlog(syslog_ident, options, facility);
I don't think this is necessary?
Sorry. I'm not expert of Dovecot implementation...
env_put(t_strconcat("INSTANCE_NAME=", set->instance_name, NULL));
Also not needed.
I think $INSTANCE_NAME environment variable is useful for external program, e.g., custom checkpassword program.
But yeah, I guess in general it would make sense to use instance_name for syslog ident.
Thanks.
-- -- Name: SATOH Fumiyasu @ OSS Technology Corp. (fumiyas @ osstech co jp) -- Business Home: https://www.OSSTech.co.jp/ -- GitHub Home: https://GitHub.com/fumiyas/ -- PGP Fingerprint: BBE1 A1C9 525A 292E 6729 CDEC ADC2 9DCA 5E1C CBCA
On 01.06.2018 05:46, SATOH Fumiyasu wrote:
On Fri, 01 Jun 2018 03:40:07 +0900, Timo Sirainen wrote:
When running multiple instances of dovecot on the same host (or running multiple docker container), it is hard to distinguish logs from different processes: the syslog entries are all prefixed with the same identifier "dovecot" It is hardcoded here: https://github.com/dovecot/core/blob/master/src/lib-master/master-service.c#...
Would it make sense to use the already implemented instance-name as syslog ident? How do others solve that problem? I have a patchset to implement that. Please see the attachment. Subject: [PATCH 1/2] master: Do not prepend "dovecot-" to a process name Why not? I'd think it would be useful to always find dovecot processes. I want to use 'director/*' names, not 'dovecot-director/*' for short name.
- openlog(ident, options, facility);
- static char *syslog_ident = NULL;
- i_free(syslog_ident);
- syslog_ident = i_strdup(ident);
- openlog(syslog_ident, options, facility);
I don't think this is necessary? Sorry. I'm not expert of Dovecot implementation...
Also not needed. I think $INSTANCE_NAME environment variable is useful for external program, e.g., custom checkpassword program.env_put(t_strconcat("INSTANCE_NAME=", set->instance_name, NULL));
But yeah, I guess in general it would make sense to use instance_name for syslog ident.
Thanks.
This feature has been merged.
Aki
participants (5)
-
A. Schulze
-
Aki Tuomi
-
Benny Pedersen
-
SATOH Fumiyasu
-
Timo Sirainen