Questions tagged [syslog]

Syslog is a standard for logging program messages.

Syslog is a standard for logging program messages.Wikipedia

1162 questions
12
votes
3 answers

Syslog messages show up as "Unknown" when I use Python's logging.handlers.SysLogHandler

When I run this on my mac: import logging.handlers logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) syslog_address = '/var/run/syslog' logger.addHandler(logging.handlers.SysLogHandler(syslog_address)) logger.error("What the…
Nick Retallack
  • 18,986
  • 17
  • 92
  • 114
12
votes
4 answers

Is there any way to 'expect' output to error_log in PHPUnit tests?

Is there any way to run a test on output created from a call to 'error_log("Message")' when doing unit tests with phpunit? Example code, one of my functions tests a credit card with a luhn algorithm: if($checkLuhn && ($this->_luhn_check($cardNumber)…
Scott
  • 7,983
  • 2
  • 26
  • 41
12
votes
2 answers

Writing log data to syslog using log4j

I'm unable to write log messages into syslog. Any help would be great. Here is my simple log4j program import org.apache.log4j.Logger; import java.io.*; import java.sql.SQLException; import java.util.*; public class log4jExample { /* Get actual…
Sandeep Rao
  • 1,749
  • 6
  • 23
  • 41
12
votes
1 answer

syslog_r for Linux?

Folks, I can't find the re-entrant version of syslog() for Linux...is there one? And if no, what do you? The obvious answer is to move logging facility into separate thread and serialise access to syslog...
pachanga
  • 3,003
  • 4
  • 30
  • 45
12
votes
2 answers

How to configure syslog so that an applications log goes to a specific file

I have an application myapp which should send log files only to /var/log/myapp.log. myapp is written in C++. The following sample code, sends the logs to /var/log/syslog only. My os is Linux - Ubuntu 12.04 - to be specific. I also found that my…
suresh
  • 1,109
  • 1
  • 8
  • 24
11
votes
4 answers

how to get php errors to show on syslog

I have a script which is scheduled to run on crontab. I noticed that I could not see php errors anywhere. I wanted to be able to see php errors logged on /var/log/syslog or some place else. I have tried configuring my php.ini to log the errors on…
madkris24
  • 483
  • 1
  • 4
  • 16
11
votes
4 answers

Adding year in the syslog message (linux)

I need to log the year in the log message generated by syslog daemon. In particular in the /var/log/secure file. Is it possible? Here an example of normal syslog message: Feb 16 04:06:58 HOST sshd[28573]: Accepted password for USER from SOURCE port…
Possa
  • 2,067
  • 7
  • 20
  • 22
11
votes
2 answers

Python SysLogHandler over TCP: handling connection loss

I have a process sending logs to a syslog server over TCP using logging.SyslogHandler. Unfortunately, if the syslog server is restarted for some reason, the process stops sending logs and is unable to re-establish the connection. I was wondering if…
n3g4s
  • 123
  • 1
  • 7
11
votes
0 answers

Using Syslog's unix socket with Log4J2

I would like to send the logs of an application on a rsyslog server using the client protocol : Unix socket. Both application and rsyslog server are on the same machine. I've been comparing different logging tools : Log4J, Logback and…
11
votes
1 answer

how to write to kiwi syslog server log c#

I have a program that I need to send some logs into Kiwi Syslog Server. I have looked around the net for a guide in c#, but I found nothing. I would like to have an easy to understand explanation of how to do it. Whenever someone clicks on a button…
Alon M
  • 1,583
  • 7
  • 30
  • 44
11
votes
2 answers

Using syslog in rails application

I am thinking of using syslog in my rails applications. The process is outlined in this blog post: Add gem 'SyslogLogger' to your Gemfile Add require 'syslog_logger' to the top of config/environments/production.rb Also uncomment the config.logger =…
Roger
  • 1,843
  • 3
  • 20
  • 22
10
votes
1 answer

How to avoid Broadcast messages from syslog printed on the console

I have a written a small code to send messages to syslog using C Api's when there is failure to connect to postgres database. int main ( int argc, char **argv ) { PGconn *psql; PGresult *res; int flag = 0; openlog (…
Nikhil
  • 576
  • 1
  • 11
  • 31
10
votes
1 answer

How to use tail with syslog file wrap-around?

Upon certain conditions /var/log/syslog file is saved to /var/log/syslog.0 and a new empty /var/log/syslog is created to serve the system. The problem is - if tail -f /var/log/syslog runs during the above switch, then tail stops showing anything…
KostaZ
  • 710
  • 1
  • 7
  • 17
10
votes
4 answers

How to make log4j syslog appender write a stack trace in one line?

I am using log4j syslog appender and notice that when an exception occurs the appender writes every entry in the stack trace as a new line. Is there a way to configure it so that the entire stack trace will go as one line instead of multiple lines?
Joly
  • 3,218
  • 14
  • 44
  • 70
10
votes
3 answers

How to configure Tomcat to log everything via syslog?

I'm trying to configure Tomcat and a webapp (Atlassian JIRA) to log everything over syslog. Here is what I added to the webapp log4j.properties (atlassian-jira/WEB-INF/classes/log4j.properties) : log4j.rootLogger=WARN,…
Philippe
  • 1,206
  • 3
  • 13
  • 19
1 2
3
77 78