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
27 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
86 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
132 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
115 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 ...
1
vote
1answer
194 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 ...
3
votes
4answers
136 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 == ...
9
votes
2answers
355 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 ...
1
vote
1answer
224 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 ...
0
votes
1answer
48 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
36 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
90 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, ...
0
votes
2answers
97 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
139 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 ...
12
votes
6answers
437 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 ...
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
97 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 ...
1
vote
0answers
28 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
506 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 ...
2
votes
2answers
226 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
4answers
149 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
40 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
540 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 ...
1
vote
0answers
125 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 ...
-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
123 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 ...
1
vote
3answers
89 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 ...
11
votes
3answers
837 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>) ...
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) { ...
1
vote
1answer
1k 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); // ...
2
votes
1answer
56 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() ...
4
votes
2answers
185 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
332 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. ...
26
votes
6answers
7k 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 ...
1
vote
0answers
120 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 ...
4
votes
3answers
812 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. ...
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 ...
1
vote
1answer
47 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 = ...
1
vote
2answers
428 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. ...
1
vote
2answers
157 views

Logging function names on systems with few (memory and space) resources

Our logging module has a buffer that often gets full and we are searching for a solution to shorten our logs, without making any compormise in performance. The code is written in C++ and currently we ...
5
votes
5answers
520 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 ...
0
votes
3answers
951 views

Convention for logging within nested try catch blocks

I've looked at this question but it doesn't really help solve my dilemma. System 1 calls system 2 within a try catch, the method in system 2 has it's own try catch, which sadly handles an exception ...
0
votes
2answers
45 views

How do we sequence logs from different services in a system?

So, if I am designing a system as a set of different roles (client, app-server, backend services 1 to n). Each of these roles will have their own logging mechanism. I can aggregate all the logs at one ...
2
votes
2answers
222 views

Exception messages and event logging - which tense to use? [closed]

Do you have best practices regarding to which tense to use in message when you're coding exception-throwing or message-logging code: "Could not acquire connection from DataSource" versus "Can not ...
0
votes
2answers
285 views

Printing to out vs Logging, given the nature of this app?

I'm writing a command line application in Java. That app will scan a list of remote resources, do several attempts to access those resources, report failed attempts, and if succesfully accesed, ...
0
votes
1answer
188 views

Tracing and Logging per item instead of per application

I'm building a service in .NET that process "things" in the background and I'd like to trace the execution of these things per item, not per application. Most logging frameworks (I'm familiar with ...
7
votes
1answer
2k views

Log to file or to database table?

I'm developing a web application which uses MS SQL for various data: including users, user accounts, user licenses, license prices, invoices. I need to log users' real-time usage of the system, and ...
3
votes
1answer
212 views

Should I put logging in common shared libraries? [duplicate]

Should you add logging to common libraries that are used in many applications? For example, if I have a parser that's used in multiple apps, should I add logging inside the parser? My concern is that ...
8
votes
2answers
707 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 ...