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
17
votes
4 answers

What's the correct way to write to the script console (console.log) in IE?

I have this substitute for console.log defined in document.ready(): $(document).ready(function(){ console.log("doc ready"); if(typeof console === "undefined"){ console = { log: function() { } }; } } I thought IE was supposed to have this…
Harry Bennett
  • 179
  • 1
  • 1
  • 3
17
votes
1 answer

nginx: Is it possible to capture response headers in access log when using nginx as a reverse proxy?

We are using nginx as a reverse proxy to control and log access to a Clojure (Java) web service application. We are able to generate an access_log and capture incoming headers using nginx just fine. Our Clojure app logs activity via log4j. Trouble…
jkndrkn
  • 4,012
  • 4
  • 36
  • 41
17
votes
5 answers

Clear logs in native Docker on Mac

I want to get rid of huge container log files on my docker env. I have problem finding them when running native Docker on a Mac. I am not using docker-machine (virtualbox) thing. My docker version is 1.13.1. When I do docker inspect…
Axel Janduneaz
  • 175
  • 1
  • 6
17
votes
3 answers

Using alembic.config.main redirects log output

I have a script that performs database operations alongside an alembic API call to upgrade a newly created database to head. I am having an issue with a python logger instance where logs are written to a file using a module level logger. Then the…
trendsetter37
  • 582
  • 8
  • 15
17
votes
1 answer

Where to configure logging?

I'm wondering where to configure and initialize stuff related with logging module? For example I writing some class and I want to log some info while method will be executed. Should I configure logging in init or above class on the top of module: #…
Symonen
  • 628
  • 2
  • 7
  • 19
17
votes
2 answers

How to make nginx print full log for tcp stream

I'm using nginx-1.11.8 with the following configuration. stream { log_format basic '$time_iso8601 $remote_addr ' '$protocol $status $bytes_sent $bytes_received ' '$session_time $upstream_addr…
ncubrian
  • 421
  • 1
  • 3
  • 14
17
votes
6 answers

error log truncated in laravel 5.3

i have this entry in my laravel 5.3 log 2016-12-22 17:23:37] local.ERROR: GuzzleHttp\Exception\ClientException: Client error: POST https://api.sparkpost.com/api/v1/transmissions resulted in a 400 Bad Request response: { "errors": [ {…
Toskan
  • 13,911
  • 14
  • 95
  • 185
17
votes
3 answers

java.util.logging: how to set level by logger package (or prefix)?

My app uses many libraries and I'm using java.util.logging for logging. I'd like to be able to set different logging levels for each library by doing something like: org.datanucleus.*.level = WARNING com.google.apphosting.*.level =…
Igor Gatis
  • 4,648
  • 10
  • 43
  • 66
17
votes
3 answers

How to redirect System.out to a log file using Logback?

How can I use Logback to capture System.out messages in a Java program? For example, I would like to use this code: System.out.println("test: console out to file instead"); ... and capture it's output to a file. Can this be done using the…
Matthew
  • 8,183
  • 10
  • 37
  • 65
17
votes
2 answers

Spring boot multiple log files

In my Spring boot project with "@Slf4j" annotated classes, for certain classes I want to log to a different file. But couldn't figure out how to do that. I have one logback-spring.xml file, which is referenced from my properties file like…
Spring
  • 11,333
  • 29
  • 116
  • 185
17
votes
2 answers

Multiple filters for one logger with Serilog

I am trying to setup Serilog with my ASP.NET Core application. I'd like to have one log file for all controllers, one for all services, one for the rest and ideally one which contains everything. Every controller is inheriting BaseController and…
Carsten Franke
  • 1,649
  • 2
  • 13
  • 30
17
votes
3 answers

How to put log file in user home directory in portable way in logback?

I would like to put log file into user home directory. How to do that in portable way, i.e. working on Windows, Linux and Mac?
Dims
  • 47,675
  • 117
  • 331
  • 600
17
votes
3 answers

Angular2 Logging

I am looking to introduce logging to an angular2 app and want to check any good libraries or approaches you could recommend on this. Requirements for logging are: Will have options configure logging like info, warn, error, debug and verbose. Will…
Neel
  • 179
  • 1
  • 1
  • 4
17
votes
4 answers

SLF4J Log Level as an argument

We are looking to use SLF4J, but one thing we found was that you can't specify the level as an argument, i.e Logger.log(Level.INFO, "messsage"); You have to do this logger.info("message"); this prevents being able to pass everything through a…
marchaos
  • 241
  • 1
  • 2
  • 5
17
votes
3 answers

SpringBoot logging - extraneous hyphen at start of every log entry

I am trying to eliminate a leading hyphen from our console and file logs in SpringBoot 1.3.5.RELEASE with default logback config. Logging pattern looks like: logging: pattern: console: '%d{yyyy-MM-dd HH:mm:ss.SSS}…
Tom Bunting
  • 1,845
  • 16
  • 24
1 2 3
99
100