Questions tagged [logging]

Computer data logging is the process of recording events in a computer program or computer system, usually with a certain scope, in order to provide an audit trail that can be used to understand the activity of the system and to diagnose problems. Be sure to include appropriate software or hardware tags in addition to this tag.

Logging

Computer data logging is the process of recording events in a computer program, usually with a certain scope, in order to provide an audit trail that can be used to understand the activity of the system and to diagnose problems. Logs are essential to understand the activities of complex systems, particularly in the case of applications with little user interaction (such as server applications).

Examples

Examples of physical systems which have logging subsystems include process control systems, and black box recorders installed in aircraft.

Many operating systems and complex computer programs include some form of logging subsystem. In the simplest case, log messages are written to a log file. Most operating systems and software frameworks also provide more sophisticated services for logging. One example is the syslog service (described in RFC 3164), which allows the filtering and recording of log messages to be performed by a separate dedicated subsystem, rather than placing the onus on each application to provide its own ad hoc logging system.

A server log is a log file (or several files) automatically created and maintained by a server of activity performed by it. A typical example is a web server log which maintains a history of page requests.

An audit log is a security-related log that provides documentary evidence of the sequence of activities that have affected at any time a specific operation, procedure, or event.

Standards

SysLog

Syslog is an informal standard for computer data logging that was developed in the 1980s by Eric Allman. It was created solely for Sendmail but proved so valuable that other applications began using it as well. It has since become the standard logging solution on Unix and Unix-like systems; there have also been a variety of implementations on other operating systems and it is commonly found in network devices such as routers.

The Internet Engineering Task Force has documented (but not formalized) the standard in RFC 5424.

Common Log Format

The Common Log Format (also known as the NCSA Common log format) and Extended Log Format are standardized text file formats used by web servers when generating log files. Because the formats are standardized, the files generated may be analyzed by a variety of web analysis programs.

Common Log Format entries take the form:

host ident authuser date request status bytes

Eg: 127.0.0.1 user-identifier frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326


References

41059 questions
18
votes
1 answer

Is there a way to change the filemode for a logger object that is not configured using basicConfig?

If I create a logger object by using logger = logging.getLogger("Name") I am unable to change the filemode from append('a') to write ('w'). I can if I use the root logger with basicConfig, but then I get a lot of system debug messages being logged…
Xivilai
  • 2,481
  • 3
  • 15
  • 15
18
votes
2 answers

Why would one use ELMAH if the application is using NLog

I have to write a centralized logging framework. Basic requirements are: Log exceptions as well as other details if needed to SQL Server DB. If DB is down i.e. a failover option is to log to a file and email I had done some reading around and…
gbs
  • 7,196
  • 5
  • 43
  • 69
18
votes
1 answer

Java Logging exceptions, use getMessage or toString : log.warn(ex.getMessage()) or log.warn(ex) working with open source

My question is: it better to log with getMessage or with toString or both? taking in to account errors thrown by open source. Saw the questions in the comments but did not get an answer to this. Maybe I missed something ? Do not mind the small…
tgkprog
  • 4,493
  • 4
  • 41
  • 70
18
votes
2 answers

using tabulation in Python logging format

I'm using the python logging module with the "native" configuration file support (config.fileconfig) as describe in the documentation here : http://docs.python.org/library/logging.html (see the logging.conf file) I was wondering if it's possible to…
yorjo
  • 1,699
  • 3
  • 12
  • 14
18
votes
1 answer

How to proper log every exception using OWIN

my question should be quite simple, but unfortunately I had no luck in solving it. Basically, I have some Web API controllers hosted by OWIN and deployed on Azure. I really need to track down exceptions that occur in each middleware (for example…
Menion Leah
  • 341
  • 2
  • 11
18
votes
1 answer

Android Log Levels

Android supports various log levels, Verbose, Debug, Info, Warn and Error. I understand how the logging levels work; I'm more interested in the typical output expected for a given level. For example, when developing an application I might be…
user238638
18
votes
4 answers

SVN - Get all commit messages for a file?

Is there a way to get a nice list of all commit messages sorted by file? Something like this (as you can see, I don't want the messages specific to a certain file, just show messages for the entire commit if the file was part of the commit, repeats…
davidosomething
  • 3,379
  • 1
  • 26
  • 33
18
votes
4 answers

Download Log from AppEngine Including Python Log Statements

I know you can download the raw access logs with appcfg.py, but I'm really interested in all the information around a specific request like python logging statements, exceptions and api statistics (just like the online log viewer). Does anyone know…
Koen Bok
  • 3,234
  • 3
  • 29
  • 42
18
votes
3 answers

Is there a command line option for setting the default log level in Java

Can I do something along the lines of: -Djava.util.logging.loglevel=FINE Obviously that doesn't work, but you get the idea. Is there anything like that? Or am I forced to create a properties file?
Ben McCann
  • 18,548
  • 25
  • 83
  • 101
18
votes
4 answers

Does .NET have something similar to Java's garbage collection log?

Does .NET have something similar to Java's garbage collection log? I want to write GC stats to a log in a production application. Google doesn't tell my anything useful and SO doesn't seem to have any related questions either. Thanks
Shahbaz
  • 10,395
  • 21
  • 54
  • 83
18
votes
5 answers

Logging to a file on the iPhone

What would be the best way to write log statements to a file or database in an iPhone application? Ideally, NSLog() output could be redirected to a file using freopen(), but I've seen several reports that it doesn't work. Does anyone have this…
Mike McMaster
  • 7,573
  • 8
  • 37
  • 42
18
votes
5 answers

Is log4net much slower than System.Diagnostics.Trace?

I'm investigating the differences between using log4net and System.Diagnostics.Trace for logging, and I'm curious about the performance differences I've observed. I created a test application to compare the performance of both logging methods in…
OwenP
  • 24,950
  • 13
  • 65
  • 102
18
votes
3 answers

Turn off logback logging for other libraries while in certain class

I am successfully using Spring's @Scheduled annotation to execute a method every few seconds. The only issue is that I get a lot of log messages about transactions, etc from Hibernate and Spring because of this method. I want to keep the logging…
johnktims
  • 581
  • 2
  • 7
  • 14
18
votes
1 answer

log4net configuration exception

I am using log4net for logging. My logging configuration is stored in a separate file. Web.Config:ConfigSections
Specifying my config file in…
ram
  • 11,468
  • 16
  • 63
  • 89
18
votes
5 answers

How to make Rails.logger.debug print hash more readable

I'm using Rails.logger.debug print variables for debugging purposes. The issue is it prints hashes in an impossible to read format (can't distinguish keys from values). For example, I add the following lines to my code base #code_base.rb my_hash…
User314159
  • 7,733
  • 9
  • 39
  • 63