Nakai Toru (Technical Support)
2016-Mar-28 10:54 UTC
Is it possible to extend log message?
Hello folks, Is it possible to extend log message as large as PATH_MAX? Current length of message format including file path is small against linux PATH_MAX, 4096. diff --git a/log.c b/log.c index ad12930..95df4a9 100644 --- a/log.c +++ b/log.c @@ -359,7 +359,7 @@ log_redirect_stderr_to(const char *logfile) log_stderr_fd = fd; } -#define MSGBUFSIZ 1024 +#define MSGBUFSIZ 5192 void set_log_handler(log_handler_fn *handler, void *ctx) @@ -448,11 +448,11 @@ do_log(LogLevel level, const char *fmt, va_list args) } else { #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sd - syslog_r(pri, &sdata, "%.500s", fmtbuf); + syslog_r(pri, &sdata, "%s", fmtbuf); closelog_r(&sdata); #else openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility); - syslog(pri, "%.500s", fmtbuf); + syslog(pri, "%s", fmtbuf); closelog(); #endif } Thanks nakai
On Mon, Mar 28, 2016 at 6:54 AM, Nakai Toru (Technical Support) <nakai at sgi.com> wrote:> Hello folks, > > Is it possible to extend log message as large as PATH_MAX? > Current length of message format including file path is small against linux PATH_MAX, 4096. > > diff --git a/log.c b/log.c > index ad12930..95df4a9 100644 > --- a/log.c > +++ b/log.c > @@ -359,7 +359,7 @@ log_redirect_stderr_to(const char *logfile) > log_stderr_fd = fd; > } > > -#define MSGBUFSIZ 1024 > +#define MSGBUFSIZ 5192 > > void > set_log_handler(log_handler_fn *handler, void *ctx) > @@ -448,11 +448,11 @@ do_log(LogLevel level, const char *fmt, va_list args) > } else { > #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) > openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sd > - syslog_r(pri, &sdata, "%.500s", fmtbuf); > + syslog_r(pri, &sdata, "%s", fmtbuf); > closelog_r(&sdata); > #else > openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility); > - syslog(pri, "%.500s", fmtbuf); > + syslog(pri, "%s", fmtbuf); > closelog(); > #endif > } > > Thanks > > nakaiPossible? Probably, But what precisely were you thinking needs more than 500 characters?
Nakai Toru (Technical Support)
2016-Mar-28 11:16 UTC
Is it possible to extend log message?
On 2016/03/28 20:04, Nico Kadel-Garcia wrote:> Possible? Probably, But what precisely were you thinking needs more > than 500 characters?Because of the message is suppressed if the path name is very long as following. Mar 28 00:00:00 hostA sftp-server[123]: set "/very/long/path/name/here" mod ^^^^ So we can't see what "modtime" is set in this case. Thanks nakai