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

Unique log file for each instance of class

I am currently running a windows service that creates multiple instances of a class. At the top of the service class and every other class in my solution, I have something like this: private static readonly ILog _log =…
Killnine
  • 5,728
  • 8
  • 39
  • 66
17
votes
3 answers

How do I not log a particular type of Exception in Logback?

How do I configure Logback to ignore logging on exceptions of a particular type?
James McMahon
  • 48,506
  • 64
  • 207
  • 283
17
votes
1 answer

Logging in console application (.NET Core with DI)

guys. I try to add logging to my console app with DI (.NET Core 3.1) and seems that IoC container works fine for that, injects logger dependency to my classes, but LogXXX method doesn't log to output. What can be the reason? Maybe there are some…
Ivan Khorin
  • 827
  • 1
  • 5
  • 17
17
votes
5 answers

Rails audit system with both ActiveResource and ActiveRecord

I have a huge project with both of ActiveRecord and ActiveResource models. I need to implement logging of user activity with these models and also to log changes of model attributes (save object state or somthing like that). Changes can made by…
Fivell
  • 11,829
  • 3
  • 61
  • 99
17
votes
3 answers

how do I encrypt data in R?

I am adding a sentry handler to the R logging package. currently django-sentry validates the client (the application sending log records) based on a shared key which travels in clear text in a secured channel. I was wondering if it was possible to…
mariotomo
  • 9,438
  • 8
  • 47
  • 66
17
votes
0 answers

How to hide os_log timestamp prepended in Xcode console?

When I change to log my messages from print to os_log, it indeed provided very detail timestamp for each message. But sometimes I does not need the long timestamp information occupied screen space. How to hide/reformat the Xcode's console or could…
Chen OT
  • 3,486
  • 2
  • 24
  • 46
17
votes
6 answers

Feign Client request and response and URL Logging

How I can log the payload of Feign client request, response and URL. do I have to Implement an Interceptor? Because my requirement is logging the request and response on a special table on the database.
Rami Nassar
  • 303
  • 1
  • 4
  • 13
17
votes
4 answers

Apache CXF LoggingInInterceptor is deprecated - what to use instead?

I am using Apache CXF with Spring Boot with the help of cxf-spring-boot-starter-jaxws plugin of version 3.2.7. My intention is to customize the LoggingInterceptors but when I created the below class: public class CustomLoggingInInterceptor extends…
alegria
  • 931
  • 2
  • 10
  • 25
17
votes
3 answers

pytest: selective log levels on a per-module basis

I'm using pytest-3.7.1 which has good support for logging, including live logging to stdout during tests. I'm using --log-cli-level=DEBUG to dump all debug-level logging to the console as it happens. The problem I have is that --log-cli-level=DEBUG…
davidA
  • 12,528
  • 9
  • 64
  • 96
17
votes
3 answers

GDPR: Encrypted logging in C#

The suggestion to encrypt log files as a means of protecting the personal data that might be contained in them is widespread. What I've not seen is a good reference implementation, which is surprising given how many companies will need this. In our…
pjc50
  • 1,856
  • 16
  • 18
17
votes
10 answers

Live javascript debugging by recording function calls and parameters

Is there a debugging system that allows me to record javascript function calls and their parameters as they occur? this would allow me to trace and debug applications in live/client situations without the performance hit due to manual logging. Edit:…
Robin Rodricks
  • 110,798
  • 141
  • 398
  • 607
17
votes
3 answers

Duplicate log entries with Google Cloud Stackdriver logging of Python code on Kubernetes Engine

I have a simple Python app running in a container on Google Kubernetes Engine. I am trying to connect the standard Python logging to Google Stackdriver logging using this guide. I have almost succeeded, but I am getting duplicate log entries with…
17
votes
1 answer

How to test console.log output using Jest or other Javascript Testing Framework?

I have a function that runs asynchronously, console logging the numbers 1 through 5 in order after a random setTimeout. I want to write a test for this function using Jest. How do I write one that tests that the console.log is 1, 2, 3, 4, 5 ?
fafafariba
  • 335
  • 1
  • 2
  • 12
17
votes
2 answers

How to create a new log file every time the application runs?

Currently, this is what I have (testlog.py): import logging import logging.handlers filename = "example.log" logger = logging.getLogger() logger.setLevel(logging.DEBUG) formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s -…
17
votes
3 answers

keep the nginx logs of the last 30 days

I want to keep the nginx logs of the lsat 30 days. The default configuration is 15 days, as the image shows. I would like to keep the last 30 days instead. Here are the looging settings of nginx: ## # Logging Settings ## …
Chuck Aguilar
  • 1,998
  • 1
  • 27
  • 50
1 2 3
99
100