2

My code contains a lot of std::cout.
I got a call from sysadmin telling me that I am filling up the /var/log/messages folder and the syslog filesystem. But, my user ID does not have access to either /var, which requires root permissions for writing, I don't use syslog.
My assumption is that somehow, Linux must be configured to redirect cout to the syslog server.

My question is what are the settings in Linux, which makes the above feasible (i.e. redirect cout to syslog)?

Eitan T
  • 32,660
  • 14
  • 72
  • 109
Jimm
  • 8,165
  • 16
  • 69
  • 118
  • How do you invoke your program? – Matt K Jun 13 '12 at 14:19
  • 1
    What makes you think that your heavy use of std::cout and the filling up of /var/log/messages is related? – DevSolar Jun 13 '12 at 14:20
  • If you want to redirect stdout to syslog, this question is not about C++ programming. Try adding better flags, maybe you'll get linux users attention ;) – Alessandro Pezzato Jun 13 '12 at 14:24
  • @DevSolar The log messages shown by sysadmin are same what i would see on bash terminal via cout – Jimm Jun 13 '12 at 14:24
  • @AlessandroPezzato I dont want to redirect to syslog. Infact, i am confused to why std::cout are being redirected to syslog. Hence, if i get to know what settings on linux enable this redirection, i can look them up. – Jimm Jun 13 '12 at 14:25
  • @Jimm Sorry, just misinterpreted question. Are you calling this program from cron or something similar (not a terminal)? – Alessandro Pezzato Jun 13 '12 at 14:27
  • no, i am calling the program from bash terminal like ./myprogram – Jimm Jun 13 '12 at 14:30
  • The solution is in: https://stackoverflow.com/questions/2638654/redirect-c-stdclog-to-syslog-on-unix – tres.14159 Mar 28 '22 at 16:12
  • What is the name of this program? – jxh Mar 28 '22 at 19:22

0 Answers0