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.
272 questions
0
votes
4
answers
130
views
Approach to tagging/versioning builds of an executable
In a certain software project I'm involved with, (one or more) of the executables which get built to write logs, and it is customary/expected for those logs to include some sort of tag or version ...
1
vote
4
answers
185
views
What is a log and what is a trace? [closed]
The words "log" and "trace" are used regularly for describing information, written to an external file during execution of a program, but is there a fix and firm definition?
Some ...
1
vote
3
answers
120
views
Python logging in shared functions called by multiple main programs
I have reviewed this, but it doesn't seem to address what I'm asking here.
https://stackoverflow.com/questions/15727420/using-logging-in-multiple-modules
I want to have multiple programs call the same ...
10
votes
8
answers
6k
views
What is the advantage of log file rotation based on file size?
I understand that log file rotation is changing the log file you used when (1) one gets big enough or (2) at EOD, but I'm not sure I understand the reason for (1). I have never had any issues with ...
1
vote
1
answer
189
views
Inheriting a logger
When you define a class, is inheriting a logger such as log4cxx a good design?
Assume I am defining a class called MyClass.
When I want a logger, I use a pointer to an abstract logger class as a ...
0
votes
0
answers
187
views
Approach for comprehensive data/activity logging
I would like to be able to build up a log of user activities, capturing data such as who they were, where they logged in from, what activity did they take, and what data did they change (both before ...
2
votes
2
answers
325
views
When to prefer print over logging?
Generally print statements are frowned upon in favor to logging. But are there any situations where I should prefer using print statements?
In a interactive command line application, if I ask for user ...
0
votes
1
answer
157
views
AWS and cron job: improve logging, monitoring and concurrence
In my company, we use a separate cron server to run mission-critical background jobs that run on a single ec2 instance: the whole platform is then vulnerable to anything going wrong on this instance.
...
-1
votes
1
answer
182
views
Should the logging utilities be exposed as public API?
In my library I've got a Logger class that is a wrapper around spdlog, that I use internally for logging. Logging is enabled by default in Debug builds and disabled in Release builds, moreover user ...
0
votes
1
answer
79
views
Best practices for storing logs from worker processes in Azure?
We have a .NET 6 application that consists of a REST API running in Azure App Service, and long-running background jobs hosted in Docker containers. These jobs are triggered by messages in a message ...
0
votes
1
answer
120
views
Logging, with optional foreign key cross reference
I am wanting to enhance a system to execute various background tasks (primarily data importation). In order to provide data for support, analysis and job status generally, I had been thinking of ...
23
votes
5
answers
7k
views
Should I use a global logging variable?
Over and over again we're told, "globals are bad" and with good reason. However, I'm working with a logger that needs to be accessible everywhere in the program. Why shouldn't I create a ...
0
votes
1
answer
489
views
Cheap But Effective Solution for Logging in a private rest microservices backend api
I've created a backend following a microservices architecture and now I need to implement logging.
my understanding
After reading some articles about this topic, I've listed below some "pretty ...
-3
votes
2
answers
88
views
Optimal variable-time logging of a real-time data stream
Cross-posted from stats stackexchange
Say I have a logging utility in my application that I use for recording timestamped diagnostic log messages. I want to add tracking of some performance metrics to ...
1
vote
1
answer
108
views
Should a LoggingHandler log?
I wrote a custom log handler that has a config file and uses a service on the network. Now I'm wondering if it should itself log.
Pro:
Everyone should log, it helps track errors, especially when you'...
4
votes
2
answers
2k
views
What log level should be used for an expected but (potentially) bad occurrence?
In my team we are currently building an API gateway, where the client can authenticate themselves with an API key. Naturally the authentication may also fail, which produces a message in the log.
...
7
votes
4
answers
5k
views
log levels and stdout vs stderr
I'm writing an app which uses a logger with different logging levels (info, debug, warning, error, etc.); but - I'm used to the idiom of writing program output to stdout and error information to ...
0
votes
2
answers
106
views
TL suggests that testing, refactor, and tool usage could avoid the need for verbose logging
Additional Context
I make infrastructure for automated device testing. Debugging can be very time consuming because the devices have many states and are constantly being updated with new builds which ...
0
votes
2
answers
185
views
How to refactor code so that a facade class could be decoratable?
I've got a class that is a facade class (encapsulates complex-ish behaviour for reusability). It has a function called manage (the class is called Manager):
function manage()
{
$entityBuilder = '...
8
votes
4
answers
14k
views
How to get an ILogger instance from extension methods?
Let's say I have this service abstraction exposed from a library.
public interface INavigator
{
ImmutableList<IPageViewModel> Entries { get; }
void NavigateForward(IPageViewModel page);
...
7
votes
4
answers
3k
views
How to provide logging to consumers of a NuGet package/library
I've been building a library (NuGet package as I'm in the C# world here) & I want to add logging so the consumer of the library can optionally provide some logger to the library. However, there ...
2
votes
2
answers
546
views
How to split logging into streams?
I am looking for an advice (or an example) on how to organize logging streams in my cloud app (C#).
In my app there are logging events related to the application infrastructure level and I want to ...
31
votes
10
answers
6k
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
1
answer
134
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
1
answer
152
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
1
answer
212
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 ...
3
votes
1
answer
829
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 ...
1
vote
1
answer
552
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 ...
4
votes
0
answers
1k
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
2
answers
1k
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
1
answer
367
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
2
answers
132
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
1
answer
321
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
2
answers
1k
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(...
0
votes
1
answer
933
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 ...
3
votes
1
answer
1k
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>.")
...
10
votes
6
answers
7k
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
0
answers
37
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 ...
4
votes
3
answers
267
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
1
answer
152
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 ...
-2
votes
2
answers
2k
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
0
answers
246
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
1
answer
76
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
5
answers
805
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
2
answers
295
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
2
answers
295
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
3
answers
774
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
4
answers
868
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
0
answers
78
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
0
answers
588
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) ...