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
544
votes
10 answers

How to show the last queries executed on MySQL?

Is there any query/way to show the last queries executed on ALL servers?
FerranB
  • 35,683
  • 18
  • 66
  • 85
516
votes
24 answers

How can I log SQL statements in Spring Boot?

I want to log SQL statements to a file. I have the following properties in…
Oleg Pavliv
  • 20,462
  • 7
  • 59
  • 75
508
votes
44 answers

How can I color Python logging output?

Some time ago, I saw a Mono application with colored output, presumably because of its log system (because all the messages were standardized). Now, Python has the logging module, which lets you specify a lot of options to customize output. So, I'm…
airmind
  • 7,361
  • 4
  • 18
  • 6
503
votes
10 answers

How to output git log with the first line only?

I am trying to customize the format for git log. I want all commits to be shown in one line. Each line should only show the first line of the commit message. I found out that git log --pretty=short should do the trick but on my computer it shows the…
JJD
  • 50,076
  • 60
  • 203
  • 339
474
votes
13 answers

How to log PostgreSQL queries?

How to enable logging of all SQL executed by PostgreSQL 8.3? Edited (more info) I changed these lines : log_directory = 'pg_log' log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' log_statement = 'all' And restart PostgreSQL…
Paul
  • 12,359
  • 20
  • 64
  • 101
473
votes
37 answers

How to do logging in React Native

How can I log a variable in React Native, like using console.log when developing for web?
ljk321
  • 16,242
  • 7
  • 48
  • 60
469
votes
14 answers

Where is the Docker daemon log?

Where is the Docker daemon log? Oddly cannot find an answer to this via man, StackOverflow or Docker Docs. Note I am not asking for the docker container STDOUT, but the daemon log for troubleshooting communications between the client and container…
user2603634
  • 4,811
  • 3
  • 14
  • 4
461
votes
18 answers

Spring Boot: How can I set the logging level with application.properties?

This is very simple question, but I cannot find information. (Maybe my knowledge about Java frameworks is severely lacking) How can I set the logging level with application.properties? And logging file location, etc?
zeodtr
  • 10,645
  • 14
  • 43
  • 60
446
votes
31 answers

How to remove all debug logging calls before building the release version of an Android app?

According to Google, I must "deactivate any calls to Log methods in the source code" before publishing my Android app to Google Play. Extract from section 3 of the publication checklist: Make sure you deactivate logging and disable the debugging…
Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373
441
votes
13 answers

How do I disable log messages from the Requests library?

By default, the Requests python library writes log messages to the console, along the lines of: Starting new HTTP connection (1): example.com http://example.com:80 "GET / HTTP/1.1" 200 606 I'm usually not interested in these messages, and would…
aknuds1
  • 65,625
  • 67
  • 195
  • 317
435
votes
6 answers

Why not use java.util.logging?

For the first time in my life I find myself in a position where I'm writing a Java API that will be open sourced. Hopefully to be included in many other projects. For logging I (and indeed the people I work with) have always used JUL…
peterh
  • 18,404
  • 12
  • 87
  • 115
425
votes
7 answers

How to print the current Stack Trace in .NET without any exception?

I have a regular C# code. I have no exceptions. I want to programmatically log the current stack trace for debugging purpose. Example: public void executeMethod() { logStackTrace(); method(); }
Ricibald
  • 9,369
  • 7
  • 47
  • 62
408
votes
12 answers

Using logging in multiple modules

I have a small python project that has the following structure - Project -- pkg01 -- test01.py -- pkg02 -- test02.py -- logging.conf I plan to use the default logging module to print messages to stdout and a log file. To use the logging…
Quest Monger
  • 8,252
  • 11
  • 37
  • 43
383
votes
11 answers

IIS: Where can I find the IIS logs?

I'm trying to set up an application from a third party, which requires a supporting website hosted in my local IIS. I've created a website exactly as explained in their install guide, but am having some problems, and would like to see what the IIS…
Kjartan
  • 18,591
  • 15
  • 71
  • 96
369
votes
31 answers

Spring Boot - How to log all requests and responses with exceptions in single place?

I'm working on REST API with spring boot. I need to log all requests with input params (with methods, eg. GET, POST, etc.), request path, query string, corresponding class method of this request, also response of this action, both success and…
Teimuraz
  • 8,795
  • 5
  • 35
  • 62