<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="generator" content="Osso Notes">
<title></title></head>
<body>
<p>----- Original message -----
<br>> We have moved from OEL4 to OEL6 and I need help moving the 2.0.4
<br>> functionality to the new version of syslog-ng. I am having issues with
<br>> our custom application logging which has very large messages and long
<br>> stack traces. I am not seeing the same behavior in 3.2.5. In 3.2.5 I am
<br>> seeing truncated messages and the first line of the stack trace is being
<br>> logged to the correct facility local5 while the rest of the stack trace
<br>> is being logged to /var/log/messages. Also the stack trace is not being
<br>> preserved anymore. Instead every line is being treated as a new line and
<br>> a new syslog entry. Our custom app logging is not the best and contains
<br>> carriage returns which used to be stripped by 2.0.4 but that is not
<br>> happening now. Can these behaviors from 2.0.4 be preserved in 3.2.5?
<br>>
<br>> Any suggestions are appreciated.
<br>>
<br>> Here is what I am trying to work with in 3.2.5
<br>>
<br>> options {
<br>>  flush_lines (0);
<br>>  time_reopen (10);
<br>>  log_fifo_size (1000);
<br>>  long_hostnames (off);
<br>>  use_dns (yes);
<br>>  use_fqdn (no);
<br>>  create_dirs (no);
<br>>  keep_hostname (yes);
<br>>  stats_freq (50000);
<br>>  log_msg_size(8192);
<br>> };
<br>>
<br>> source s_sys {
<br>>  pipe("/proc/kmsg" log_prefix("kernel: "));
<br>>  unix-dgram ("/dev/log" flags("no-multi-line"));
<br>>
<br>
<br>this should work fine, as long as your application really submits through /dev/log.
<br>
<br>can you run syslog-ng in foreground/debug mode and see what it prints as 'Incoming message' from your application?
<br>
<br>if that's not feasible, you can alsways use strace for the same purpose (strace the app or syslog-ng) but make sure you use large string size option (-s 4096 for example) so that a longer part of the message is displayed:
<br>
<br># strace -o log.txt -s 4096 -p <pidofsyslogng>
<br>
<br>3.2 is old now, so my memory doesn't stretch that far back in time, but the source you wrote should be ok. it would be nice to find out the root cause with that version, then I can check if we fixed it in the past or if it's not syslog-ng that's buggy.
<br>
<br>Cheers
<br>
<br>   internal();
<br>>  udp(ip(127.0.0.1) port(514));
<br>> };
<br>>
<br>> destination d_cons { file("/dev/console"); };
<br>> destination d_mesg { file("/var/log/messages" perm(0644)); };
<br>> destination d_mesgr { udp("remote syslog server" port(514)); };
<br>> destination d_auth { file("/var/log/secure"); };
<br>> destination d_authr { udp("remote syslog server" port(514)); };
<br>> destination d_mail { file("/var/log/maillog" flush_lines(10)); };
<br>> destination d_spol { file("/var/log/spooler"); };
<br>> destination d_boot { file("/var/log/boot.log"); };
<br>> destination d_cron { file("/var/log/cron"); };
<br>> destination d_cronr { udp("remote syslog server" port(514)); };
<br>> destination d_cust_app { file("/var/log/cust_app.log" owner("test")
<br>> group("test") perm(0644)); };
<br>> destination d_kern { file("/var/log/kern"); };
<br>> destination d_mlal { usertty("*"); };
<br>>
<br>> filter f_filter1  { facility(kern); };
<br>> filter f_filter2  { level(info..emerg) and
<br>>  not (facility(mail)
<br>>  or facility(authpriv)
<br>>  or facility(cron)
<br>>  or facility(local5)); };
<br>> filter f_filter3  { facility(authpriv); };
<br>> filter f_filter4  { facility(mail); };
<br>> filter f_filter5  { level(emerg); };
<br>> filter f_filter6  { facility(uucp) or
<br>>  (facility(news)
<br>>  and level(crit..emerg)); };
<br>> filter f_filter7  { facility(local7); };
<br>> filter f_filter9  { facility(local5); };
<br>> filter f_filter8  { facility(cron); };
<br>>
<br>> log { source(s_sys); filter(f_filter1); destination(d_cons); };
<br>> log { source(s_sys); filter(f_filter1); destination(d_kern); };
<br>> log { source(s_sys); filter(f_filter2); destination(d_mesg); };
<br>> log { source(s_sys); filter(f_filter2); destination(d_mesgr); };
<br>> log { source(s_sys); filter(f_filter3); destination(d_auth); };
<br>> log { source(s_sys); filter(f_filter3); destination(d_authr); };
<br>> log { source(s_sys); filter(f_filter4); destination(d_mail); };
<br>> log { source(s_sys); filter(f_filter5); destination(d_mlal); };
<br>> log { source(s_sys); filter(f_filter6); destination(d_spol); };
<br>> log { source(s_sys); filter(f_filter7); destination(d_boot); };
<br>> log { source(s_sys); filter(f_filter8); destination(d_cron); };
<br>> log { source(s_sys); filter(f_filter8); destination(d_cronr); };
<br>> log { source(s_sys); filter(f_filter9); destination(d_cust_app); };
<br><br></p>
</body>
</html>