Questions tagged [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.

Filter by
Sorted by
Tagged with
32
votes
10answers
5k views

Does logging inside a class violate the SRP?

I wrote a class that takes a Logger class as one of its arguments: class QueryHandler: def __init__(self, query: Query, logger: Logger) -> None: self.query = query self.logger =...
-2
votes
1answer
75 views

Does it make sense to have a return type for a method doing batch operations [closed]

My application syncs data between 2 different services. Data flow looks something like this: Target <-- My Service <-- Source I have a method that starts this batch operation: // we have ...
0
votes
1answer
44 views

Aggregating logs from embedded devices

I'm trying to aggregate logs from multiple embedded devices in centralized place to be able to analyze them. This is how system looks like: I have number of embedded devices. Some deployments are on-...
2
votes
1answer
67 views

Choosing test method of bash command output with bats

Context While writing a bash script I would like to test every command I write. To do so I create a separate function per command that executes the function. In addition I want to log the output of ...
1
vote
1answer
100 views

What are the best practices to design a "verbose" mode in command line scripts?

To improve my command lines scripts, I want to add some optional console output, mainly for logging purposes. In my PowerShell modules, I use Write-Verbose for this (but it should be clear this isn't ...
2
votes
1answer
74 views

What are the best way to publish application event in a spring boot application?

My goal is to collect/publish different types of information from the application. We use Kafka for the event bus. Consider the following sample code. class UserService { public User ...
3
votes
0answers
127 views

Relational or non-relational database for storing and querying log data?

I'm planning to extend an application with logging of user events. (Client application via REST-API to Symfony). What is the preferred type of databases? Currently the log data is stored in a ...
0
votes
2answers
153 views

How do you effectively track the history of changes to a text field in the database on a content editing platform?

Say I have a website/platform that allows people to submit business names in order to build a high quality business name database. You can apply this to any subject or topic, such as building a ...
0
votes
1answer
137 views

Do I have to use Filebeat to parse logs with logstash?

I was under the impression that Filebeat is only necessary if I wish to provide a constant, paced, fresh input to logstash. But the tutorial here starts with configuring Filebeat to send log lines to ...
1
vote
2answers
79 views

How can I cleanly set up debug logging in my javascript frontend?

I basically want to be able to "turn on debug logging" like you can do with many applications that run in a shell. The naive way of implementing it would be to insert a statement like this ...
0
votes
1answer
58 views

Storing a series of diffs that create a JSON

tl;dr is there an existing, standardized way to store sequences of diffs to a JSON or JSON-type object? Question: So currently I have something a class that looks something like this (pseudocode): ...
1
vote
2answers
147 views

add function to input of builtin python logger

For simplicity, assume my application logs only dictionaries. I want to add a step to Python logging for my application to prevent logging any dictionary with the key password, i.e., def clean_log(...
-1
votes
1answer
198 views

What is "scoped logging" defined as?

I hear this term from time to time but haven't found any well defined precise technical definitions posted online. They all seem to use the notion as if the term scoped has been defined elsewhere. I ...
1
vote
1answer
214 views

What makes a before/after vs. only before approach to logging more effective?

I'm currently developing a server where I find myself asking whether something such as: logger.info("Starting <action_1>.") action_1() logger.info("Ending <action_1>.") ...
5
votes
6answers
676 views

How to insert logging information without making the code a mess

When working with some complex algorithms, I would like to have a way to keep track of some information for easy debugging. I just need to see sometimes how things are going, and have some easy way to ...
0
votes
0answers
28 views

Migrating an application using a custom API logging system

I'm turning a VB6 application into a VB.NET (using a migration tool). This software relies on a custom DLL which handles logging. This DLL logs to flat files and optionnaly in a GUI component. Also ...
3
votes
3answers
264 views

How to return "debugging" information during the execution of an algorithm

I was recently tasked with thinking about returning optional tracing information about the execution of a complex algorithm. It's the kind of data you need to analyse the inner workings - a bit like ...
-4
votes
1answer
47 views

Message Strings in Backend

Its ok to have hardcoded strings on backend? Example: Log.e("Error connecting to the database") The text "Error connecting to the database" should be hardcoded there? Or should it be in a separated ...
-3
votes
2answers
480 views

Are there any standards on log severity levels? [closed]

I'm seeking a way to generalize the way log levels are managed in my services. I have multiple services, written in multiple languages, and using multiple libraries to manage logs. Almost all of them ...
3
votes
0answers
93 views

Logging by 3rd party libraries

We've got 2 very large platforms for our services & jobs. Both platforms consists of 20+ servers hosting 1000+ services/jobs. Each job/service is essentially a java web application. Both ...
0
votes
1answer
43 views

Test logging library

I've been designing and developing a very scalable logging library for a while. The main goal of this library is pretty simple. Like many others projects, a simple goal does not mean a simple way the ...
3
votes
3answers
301 views

Are there better alternatives to debug level logs to investigate a bug in a production environment?

Some of our customers from time to time report an unexpected behavior in one feature of our software and we suspect that we have a bug. The feature itself and the kind of bug is not interesting for ...
2
votes
2answers
220 views

Logging: safety vs performance. How do I choose?

While making an application I've come to the point where I want to add logging for the inevitable case when something goes wrong. Now this seems like a problem that should have been solved decades ago,...
0
votes
2answers
133 views

Architectural solution for business logging

I have a the requirement for a webservice which should return a "business log" of the action the service performed. Usually I only return error logs which are based on exceptions. the exceptions get ...
4
votes
3answers
243 views

Should An SDK Have Logging in the API

I am working on building a API and SDK for a web service. My question is what is the correct practice for logging. Should the SDK do logging for the API methods? All the SDKs I have seen do not do ...
3
votes
4answers
300 views

What log level use for deprecated features?

There is a feature that is now deprecated and going to be removed. Adding a logging statement, observed by some alerting mechanism, can help finding out whether the feature is still being actively ...
1
vote
0answers
76 views

Why does the PHP community always rely on file-based logging instead of a combination with in-memory logging?

This is an initial thought I'm having on logging. Clearly, am missing something about the whole picture because I don't think someone didn't think of this before. PHP runs on one request. That means ...
0
votes
0answers
460 views

log centralization and central aggregation system design

I'm thinking of how would I go about creating my own logging centralization and centralized aggregation system. Imagined system has 10 - 100 nodes. Each node runs a LAMP(Linux, Apache, MySql, PHP) ...
2
votes
0answers
71 views

Database vs Logs - Persistence approach evaluation

I have a node js app, in which I need to perform background jobs. My plan is to use a data structure which will contain all the jobs needs done. My design also suggests that this data structure needs ...
1
vote
0answers
107 views

Log data anonymization with ELK

I'm considering using the ELK stack for logging within our company. To comply with our data retention policy, we would like to anonymize data after one year so it cannot be traced back to an ...
2
votes
1answer
96 views

How to Avoid Copy Pasting Repetitive Log Calls

Currently working on a Go project of about 10k lines of code. Within the project, there's a logging library that requires a couple steps of initialization in order to actually write to the log ...
2
votes
3answers
930 views

What is the proper logging level for tests?

I raised an issue at my employer concerning our gigantic heaps of testing logs. I raised the issue because I was spending well over a minute to find the relevant logs and stack-trace. I stated we ...
0
votes
1answer
141 views

I'm writing an application that needs to log error/ exception messages but should still continue execution if it not a fatal error

I'm writing an application that needs to log error/ exception messages but should still continue execution if the error is not a fatal error. I was thinking of making a method that returns a Task but ...
2
votes
3answers
633 views

Do I use Repository or Service Object to Perform Logging?

I'm working in Java Spring, and I have typical service and repository layers. The repository grabs a JSON; passes it along to the service; service maps the repository response to a DTO. I also need ...
4
votes
6answers
7k views

Is it worth logging HTTP requests when they enter an API server?

I'm designing an API and have reached the topic of logging. I'm going to store my logs in Elasticsearch. I'm certainly going to do some logging at the time the HTTP response is sent back to the ...
3
votes
2answers
575 views

Logging Config - in code vs in config file

The built-in logging module of python 3.x allows for 3 ways to define a custom logger: INI-formatted file dict, json, yaml python (directly in code) In my opinion, it is easier to define a custom ...
9
votes
5answers
2k views

Does the responsibility of logging method/function calls fall to the caller or the callee?

What are the pros and cons to each of the following ways of logging a function call? This code is written in Ruby but I feel the question applies to programming in general. Responsibility belongs to ...
0
votes
0answers
46 views

Do logs enhance availability of service for a well monitored application?

I used to work for teams that built software as a service applications. Our requirements, regarding production, were often the same : A complex service (web application, database, daemons, typically) ...
5
votes
1answer
1k views

Interview question: "How do you make sure your logs are sufficient?" [closed]

I was in a job interview with a vp r&d today. I would like to ask it here, even though it is, in my opinion, too broad as a question. One of his questions went something like: "How do you make ...
2
votes
2answers
139 views

How to implement change log of a ticket in complaint management system [closed]

One of the requirement, in the complaint management system were are designing, is to implement complete history of the ticket. For example Status was changed (new to pending to work in progres to ...
1
vote
2answers
775 views

Can there be too much logging? (Front End & Back End)

In a bit of a dilemma. At work we are having issues with an API service that communicates with the client side through a WebSocket. The problem so far is that the WebSocket seems to be unreliable. We ...
1
vote
0answers
114 views

Solution architecture for storing machine learning data

I'm building a mobile application using Expo & React Native. As the user interacts with the mobile app I need to store their interactions in Google BigQuery, so they can later be used to train ...
3
votes
2answers
358 views

Is there a specific name for this kind of debugging?

Imagine you have a system where a program is running and somehow an abnormality occurs. (it can be a crash, or an abnormal screen or any other thing) Imagine reproducing the problem is next to ...
-1
votes
1answer
375 views

What is the C++ equivalent of a logging facade in Java?

I'm currently writing a library in C++ and was wondering if I should log from within it. Googling the issue I came across this question but it makes reference to a logging facade. Is there anything ...
0
votes
1answer
276 views

When to use logger.info in sl4j

For my application logs for a REST server, I'd like to log some details about each http request. I'm using sl4j. Should I use logger.debug or logger.info More generally what sort of things should be ...
0
votes
1answer
53 views

Custom remote logging strategies

I am implementing an asynchronous remote (to aws S3) logging handler (in python, but it doesn't matter) supporting 4 modes: Immediate: the messages get written immediately to S3 - I am trying to ...
5
votes
1answer
720 views

Why would CPython logging use a Lock for each handler rather than one Lock per Logger?

While developing my own logging library, I studied the source code of the standard logging module of CPython. One of its features is that handlers are thread-safe. One can write logs to a file from ...
7
votes
6answers
3k views

Should log statements be tested?

When writing tests I usually ignored logging statements, but now I wonder if it was right. The logs are often important tools when diagnosing production issues, moreover there can even be ...
0
votes
1answer
93 views

How to ensure that every log event will be delivered to the GrayLog

In our applications we traditionally log events locally into the logging files. As our applications are distributed on multiple server instances, searching for particular events are complicated and ...
1
vote
0answers
55 views

Logfile correlation finder (for j4Log)

I'm currently analyzing a problem in a old "distributed" system, that only occurs sporadically - as the system does not support other means of debugging help I have to rely on the logs (I did not ...

1
2 3 4 5