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.

learn more… | top users | synonyms

0
votes
0answers
33 views

User-related logging in the microservices architecture

What is the best practice for logging user-related data in microservices architecture? In example: I would like to audit/persist to database information on who deleted a resource. I have user info on ...
1
vote
3answers
102 views

Event logging: record a whole message, or a list of properties and generate?

I've written a simple event logging system, which I write to with a function similar to: void IIncidentLogic.ReportIncident( string code, string noun, string hostname, DateTimeOffset ...
2
votes
1answer
261 views

Logging RestTemplate's responses

I want to log responses using Spring's RestTemplate. At first I thought I should do it using a ClientHttpRequestInterceptor, but since every set of requests should be logged to a different file, I ...
0
votes
0answers
28 views

In an ESB type system, what field name should be used as a “correlation ID”?

We're using ASP.NET Web API and Azure Service Bus and adding logging to our disparate services and systems. We need to track a correlation ID to the headers of each set of bus messages as well as logs ...
1
vote
1answer
91 views

Standalone library for error logging?

Background Here is how I currently log any exceptions that occur in my code: Pass each object instance the path to a file where I want all of the logging to happen. Each of the objects have their ...
2
votes
3answers
156 views

Logging an audit trail (Java application)

I'm creating a Java (Spring Boot) application for creating Entities. I've got my @Controller for getting the data from a web front end, I've got my @Service for processing the data, and I've got my @...
1
vote
2answers
116 views

Does it make sense to internationalize logs?

I'm working on converting the logging API used by a web application from log4j to slf4j, and noticed that the interface used to abstract over the log4j implementation supports internationalization; I ...
2
votes
1answer
25 views

Handling and reporting errors consistently

Errors can come from many different sources - third-party services, libraries, environment, etc. When an error prevents a user from performing their desired action, these diverse errors should be ...
26
votes
6answers
8k views

Why does the TRACE level exist, and when should I use it rather than DEBUG?

In Log4J, Slf4J and a couple other logging frameworks in Java, you have two "developper" level for logging: DEBUG TRACE I understand what DEBUG does, because the explanation is clear: The ...
3
votes
4answers
151 views

Logging into text file or database?

When should I use database for logging and when text files? I see that web servers and web frameworks (that your app uses internally) usually (always?) log requests and errors into text files by ...
2
votes
2answers
202 views

Can I alter the code while adding logging?

When I add logging (e.g. log4j2 in Java) to existing code, is it ok (good practice), to alter the code? Consider the following example: //if process returned 0 return true return (returnCode == ...
8
votes
3answers
761 views

How should I handle logging when I create libraries for others?

All. I am creating some libraries for other teams in my company. They all have different logging mechanisms. I want to provide trace information of what my libraries are doing. What should I to ...
9
votes
2answers
478 views

Benefits of Structured Logging vs basic logging

We're building a new app and I'd like to include structured logging. My ideal setup would be something like Serilog for our C# code, and Bunyan for our JS. These would feed into fluentd and then could ...
5
votes
5answers
530 views

How to handle exceptions that get absorbed by a 3rd party library?

I'm currently having an issue with a 3rd party control library provider. They have an exception occulting culture that gets in the way of my general fail-fast approach when developing software. An ...
1
vote
1answer
257 views

Log4j logger per class vs logger per application

I am stuck at understanding a concept related to Logger creation, especially in the context of Java EE. In my experience, I nearly always used one logger per application, with few cases when I needed ...
2
votes
1answer
2k views

Is Logger.getLogger(MyClass.class) the best way to initialise log4j loggers?

This Mkyong tutorial suggests intialising loggers this way: @Controller public class WelcomeController { private static final Logger logger = Logger.getLogger(WelcomeController.class); // ...
0
votes
1answer
54 views

Integrating Logging Library into multilayer Object: What is a good structure?

I am integrating Serilog into and existing multilayer library that I've create. The previous logging technique I used was simply passing a string up the layers with events. I'd like to get away from ...
0
votes
0answers
37 views

Logging strategy for login transactions

We have a login process which is facilitated by a product default logging mode of which is text file based. Now because that is log4j based logging, one can use the custom appended to call our ...
3
votes
3answers
96 views

Should we reuse web app logs for user behaviour analytics?

Our web app generates a large amount of logs. These logs include both events regarding background operations in the app (data arrives from the server, ajax failures, inter-component communication, etc....
0
votes
2answers
98 views

Should I log errors in the function they occur? or pass them back and log them when control returns?

One of the things I love about Go is how they encourage passing errors as return values, but when it comes to logging what is the most maintainable solution: passing the error as far back down the ...
3
votes
0answers
159 views

Log with Application Insights only (NLog vs AI) in Asp MVC

I was going through several blog posts and stackoverflow and programmers and I am still a bit confused. You can install NLog (or some other logging lib) and start logging quite fast and then you can ...
10
votes
6answers
1k views

Need to make my code more readable to the other programers in my team

I am working a project in delphi and I am creating a installer for the application, there are Three main parts. PostgreSQL installation/uninstallation myapplication ( setup of myapplication is ...
12
votes
6answers
468 views

Should I log errors on exception throwing constructors?

I was building an application for a few months and I come to realize a pattern that emerged: logger.error(ERROR_MSG); throw new Exception(ERROR_MSG); Or, when catching: try { // ...block that ...
37
votes
3answers
26k views

Best practices for logging and tracing in .NET

I've been reading a lot about tracing and logging, trying to find some golden rule for best practices in the matter, but there isn't any. People say that good programmers produce good tracing, but put ...
0
votes
0answers
28 views

Logging of sent/received emails within a web application

We're finally migrating our client/server system to the cloud and would appreciate help on the handling of email within the webapp. Currently we monitor the inbox/sent items of Outlook. It seems that ...
1
vote
1answer
102 views

Are there any arguments for using a local logger variable

PMD Rule LoggerIsNotStaticFinal: In most cases, the Logger reference can be declared as static and final. I seem to remember some arguments for using local variables for logging, but cannot ...
2
votes
2answers
233 views

Adding centralized logging mechanism to Project (Best Practice)

I want to add a logging mechanism to my project but I am afraid to have logging code spread all over the place. I thus had the idea of having only one class Logger responsible for writing relevant ...
1
vote
0answers
29 views

Most suitable solution for logging traffic to external services - ASP.NET

My application relies on several external services - labelled Service A, Service B and Service C in the diagram. I am looking at ways of logging the number of requests made to these services, and the ...
5
votes
4answers
532 views

Design pattern for wrapping logging around execution

Introduction I am implementing a abstract Java class of a processing framework*. By implementing the function execute, I am able to add business logical functionality. I would like to add logging at ...
3
votes
4answers
2k views

Logging asynchronously - how should it be done?

In many of the services I work on there are a lot of logging being done. The services are WCF services(mostly) which use the .NET EventLogger class. I'm in the process of improving these services' ...
4
votes
3answers
819 views

Write progress from a long running process

We have some long running processes which could run for as long as an hour up to 6 hours. Some of the processes are started by hand and the user wants to see what the progress of the process is. ...
31
votes
7answers
69k views

Why doesn't “object reference not set to an instance of an object” tell us which object?

We're launching a system, and we sometimes get the famous exception NullReferenceException with the message Object reference not set to an instance of an object. However, in a method where we have ...
1
vote
4answers
151 views

Better way of handling pre conditions and logging

1. Imagine you have the following: void Foo::doFoo() { if (!isConditionValid()) { log("doFoo not possible because condition is not valid"); return; } if (!...
0
votes
1answer
41 views

Should I try to read user input for logger data?

Our logger data has gotten a bit out of hand, so I am trying to find ways to trim out unnecessary log information. What I've found is that the programmer who implemented the logs (no longer working ...
1
vote
0answers
578 views

A way to trace each sqlite query

I've got big and hairy app with sqlite via dbi (from .c) as a backend - plenty of select/insert/update/delete queries. From looking through documentation I did not found a way to log all the queries ...
0
votes
1answer
57 views

Logging private data

In general, I write a debug log whenever one of my functions is entered, including the parameters. For instance: function execute_query($query, $conn_string) { $this->log->...
11
votes
3answers
856 views

Why create a Logger object instead of using static logging methods across an application?

Taking an example of a simple Ruby on Rails application. It creates a Logger object during application load process: # in environment.rb config.logger = Logger.new(<STDOUT | file | whatever>) #...
1
vote
0answers
126 views

Approach for polyglot logging

I'm building a desktop app with a Java front-end and very performance critical Fortran libraries. We've recently started pushing more of our code out of Java and into Fortran (see below) Soon we will ...
2
votes
1answer
60 views

log method calls per object

How to log method calls on a per object basis for a particular class? I.e. after instanciating a = myClass() I somehow want to keep a log for what methods have been called on a like a.reverse() a....
-1
votes
2answers
113 views

Should client side have a log? [closed]

The client side of my application is written in VB.Net, it accesses a java server. Server logs every request that was made by client, client shows every exception to the user (with an option to send ...
2
votes
1answer
140 views

Module level logger function

I've recently been assigned to a new project because I'm one of the only developers at my company who has used Python extensively in the past. My first task was to clean up the code base and make it ...
4
votes
2answers
208 views

Strategies to analyze collected exceptions

We want to add error feedback to our application. I had a look at existing solutions (e.g. raygun.io), but these work "in the cloud", which is a no-go for us: most installations of our application ...
3
votes
2answers
356 views

Is it still a good practice to log parameters and returns?

Just a context, I am currently making a base code for a Java Spring Boot Application. I am currently setting up the logging of the application and I stumbled upong this url and found it helpful. ...
1
vote
0answers
121 views

How to to log clicks for a Pay-Per-Click software?

Let say you have a Website with advertising, and each time a user clicks on it, you want to charge an advertiser the amount he bids (basically, a pay-per-click system, like Adswords, with a different ...
14
votes
6answers
3k views

Is logging next to an implementation a SRP violation?

When thinking of agile software development and all the principles (SRP, OCP, ...) I ask myself how to treat logging. Is logging next to an implementation a SRP violation? I would say yes because ...
2
votes
1answer
416 views

Design patterns to avoiding breaking the SRP while performing heavy data logging

A class that performs both computations and data logging* seems to have at least two responsibilities. Given a system for which the specifications require heavy data logging, what kind of design ...
8
votes
2answers
712 views

How should I handle logger failures?

In several of our company's applications, we use a custom logger. It's fairly robust, though we may replace it with something like NLog in the future. One of the logger's tasks is to log any ...
2
votes
3answers
1k views

Opinions on logging in multiprocess applications

We have written an application that spawns at least 9 parallel processes. All processes generate a lot of logging information. Currently we are using Python’s QueueHandler to consolidate all logs ...
1
vote
1answer
49 views

Loggers - Functional, non-functional or layered?

We use different loggers to break up and apply specific rules to different kinds of log data. We typically specify which logger to be used with something like this: var logger = Logger.GetLogger("...
1
vote
2answers
472 views

Adding Logging to a pre-existing Program

I have a game that I have been writing in java as a hobby for a number of years. I have very sparse logging, just some simple output when something goes really wrong. It's about 25,000 lines of code. ...