Questions tagged [syslog]

Syslog is a standard for logging program messages.

Syslog is a standard for logging program messages.Wikipedia

1162 questions
6
votes
1 answer

c/c++ syslog to custom file (not /var/log/syslog but /var/log/mylog) - ubuntu 12.04

I successfully tested the following syslog "hello world" example on ubuntu 12.04: // gcc giuspexample.c -o giuspexample #include int main() { setlogmask(LOG_UPTO (LOG_NOTICE)); openlog("atm", LOG_CONS | LOG_PID | LOG_NDELAY,…
giuspen
  • 1,365
  • 3
  • 20
  • 33
5
votes
2 answers

Disk failure detection perl script

I need to write a script to check the disk every minute and report if it is failing by any reason. The error could be the absolute disk failure and a bad sector and so on . First, I wonder if there is any script out there that does the same as it…
Amir
  • 5,996
  • 13
  • 48
  • 61
5
votes
1 answer

Output of syslog, sent to stdout, grepped, is getting truncated mid-line

So I'm logging some debug information, sending it to stdout whereupon I grep it for a string. At a certain point, logging is done and the application is waiting for stuff, but grep's output is truncated mid-line. So it matched a line, but didn't…
nerfist
  • 299
  • 1
  • 2
  • 4
5
votes
1 answer

python: To test sending logs to Syslog Server

please help me, how to send python script logs to syslog server (syslog-ng product), i have already tried below method.. it has two approaches. one is with 'SysLogHandler' and other is with 'SocketHandler' import logging import…
Maria628
  • 224
  • 3
  • 19
5
votes
1 answer

Can Stackdriver Logging receive syslog protocol?

Does Stackdriver Logging have the ability to receive logs via the syslog protocol? I'm using the open source Heroku Logplex router to collect logs. Logplex allows you to set up a drain to send the aggregated logs, but I think it sends it using the…
Jesse Shieh
  • 4,660
  • 5
  • 34
  • 49
5
votes
2 answers

How does linux syslogger work?

I am learning linux programming and want to do the following. I would like to create a mini-logger that will work like syslog. I want to be able to replace syslog (not in practice but just to understand at every level how things work). So in my…
Andrew
  • 53
  • 4
5
votes
4 answers

Ruby & Syslog & custom facility

I am very new playing with syslog. We have decided to use syslog to track some special events in our Rails application. The problem is that I don't want to use the default /var/log/system.log file but use a custom one like…
fguillen
  • 36,125
  • 23
  • 149
  • 210
5
votes
2 answers

Why does rsyslog replace tabs with #011?

I am using rsyslog to collect nginx logs. All looks good except the replacing usual tabs with '#011' text. Example of corrupted output: 217.118.93.88#0111473674833.412#0114418687#011... How it should look: 217.118.93.88 1473674833.412 4418687…
Samriang
  • 403
  • 6
  • 18
5
votes
2 answers

rsyslog config to store only raw message ($msg) to a file

How can I store only the raw message to a file? E.g.: I received a message via rsyslog: Received syslog message: May 4 13:18:47 xxxx apache-error: [Wed May 04 13:18:41.256596 2016] [:error] [pid 54583] [client 192.168.30.200:52638] script…
MrRolling
  • 2,145
  • 1
  • 24
  • 33
5
votes
3 answers

Is it possible to send the message produced by perror() to /var/log/syslog?

I'm using perror() to print error messages, like: pid = fork(); if (pid < 0) { perror("couldn't fork"); exit(EXIT_FAILURE); } Is it possible to use errno/perror() facilities but direct the produced messages to the system log…
João M. S. Silva
  • 1,078
  • 2
  • 11
  • 24
5
votes
1 answer

How can I use `syslog` in Swift

Looks like syslog() function is not available in Swift 2. How can I send a message to syslog on OS X?
Valentin Shergin
  • 7,166
  • 2
  • 50
  • 53
5
votes
1 answer

Log4j2 SyslogAppender not working

I'm using Log4j version 2.1 (the latest stable version) and trying to use a Syslog appender to log to a syslog server. I'm using the configuration given at their official site…
5
votes
1 answer

how to limit the total size of log files managed by syslog?

How can I limit the total size of log files that are managed by syslog? The oldest archived log files should probably be removed when this size limit (quota) is exceeded. Some of the log files are customized files specified by LOG_LOCALn, but I…
Wang Tuma
  • 893
  • 5
  • 14
  • 24
5
votes
0 answers

How to set the syslog app-name with SyslogAppender

How to set the syslog APP-NAME with a ch.qos.logback.classic.net.SyslogAppender. It seems that it's not intended.
Yann Moisan
  • 8,161
  • 8
  • 47
  • 91
5
votes
2 answers

Simultaneously write to multiple syslog facilities?

Is it possible to have one application simultaneously write to multiple syslog facilities? I have an application, written in C/C++, that I would like to write some messages to local0 and other messages to local1. I do not want the messages for…
jschmier
  • 15,458
  • 6
  • 54
  • 72