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
6 votes
2 answers
441 views

Implicitly logging the filepath of the callsite of the log-statement

Today I was challenged to build atop Python's logging module to automatically log the filepath from whence the log statement was ...
  • 619
5 votes
0 answers
45 views

Message-free flow-oriented logger

Today, I've got a small FlowLogger for you to review. The idea is not to log pure messages, but focus on the flow of the app that might contain such items as: <...
  • 43.9k
1 vote
2 answers
67 views

Find the newest file that contains a specific string in every subdirectory of the path using the least resources

I have a server side logs folder that contains many hundreds of logs most of which are in subdirectories according to the machine the logs have come from. The task is to extract the full path of the ...
4 votes
0 answers
84 views

Injectable EventLogger for custom application events that are handled differently from normal logs

I am trying to become better at designing classes for dependency injection and IOC in general. It is often not an intuitive concept. I have the following python interface and implementation for a ...
2 votes
2 answers
112 views

A simple logging library in C

I've created a simple logging library in C which I can use in my other projects. I wanted to get started in software development using the C language, and this is my first attempt at writing something ...
1 vote
2 answers
104 views

Program for monitoring file in Combined Log Format

After encountering a suggestion that monitoring a log file for a webserver could allow for the implementation of automatically analyzing and handling of certain events (that might require altering ...
1 vote
1 answer
122 views

Low-Latency Multithreaded Logger

My goal was to have a logger that does the blocking file I/O in a separate thread. A few notes: I made it a singleton rather than having a global "logger" variable, or a bunch of loggers ...
9 votes
1 answer
1k views

Python script to analyse Apache log files

I am fairly new to Python programming language. Most of python programmers have heard the philosophy behind the python programming language. The code should be easy to read, easy to understand, simple,...
2 votes
0 answers
76 views

C++ logger for Windows

I have written a simple logger in C++ on Windows that I want to use to log info and errors from multiple threads to DbgView: ...
  • 255
3 votes
1 answer
98 views

EFCore Monitor Interceptor with logging queries

I created a SqlMonitorInterceptor that will check the execution time of queries and log errors. The main idea is to log queries in such a way that they can be easily copied into SQL Server Management ...
  • 817
0 votes
1 answer
140 views

Go logging wrapper that adds log levels

The package is essentially a small wrapper around the stdlib logger that provides a very simple, easy to use logger that can toggle between different log levels (DEBUG, INFO, WARNING, ERROR). Log ...
-2 votes
1 answer
116 views

Write portable Git aliases

The following aliases return all the same number of results, on my Cygwin (on Windows): ...
0 votes
0 answers
395 views

Go middleware for logging with ZAP and elastic APM

Please be brutal with my attempt at logging middle ware. The aim of the middle ware is to tag all the logging with the same tracing detail as the apm modules from elastic that are sent to apm-server ...
2 votes
3 answers
770 views

C++ logger by template

If the log file is not available, then output the log message to the console. Any improvement or suggestion for this implementation for the logger by the template? Any potiencial problem that I should ...
  • 29
4 votes
1 answer
105 views

Improvements to logger and how to correctly use it

I am working on a project, neurodecode, which uses a logger based on the logging library. As I am not very familiar with logging, I don't know how to further ...
  • 229
4 votes
2 answers
220 views

Linux backup script written in bash for tar

This is my first attempt at scripting with bash. I am running Ubuntu server, so I don't get to use all the gui back ups out there. Besides, tar works fine for personal use. Please let me know of any ...
  • 195
2 votes
3 answers
275 views

Java logger (of doom!), updated

In a previous question, Java logger (of doom!), I had posted my own logger, written in Java. I have since taken the answers from that question and a few of my own things to update it. New code: ...
2 votes
3 answers
114 views

Java logger (of doom!)

I wrote my own logger, but I dislike how many times I overloaded the log() function. If anyone knows of another way of doing that, feel free to share. ...
3 votes
2 answers
167 views

Multithreaded logger

I made a multithreaded logger years ago when I was still a total newbie. It "worked" (when it didn't deadlock). Now that I'm slightly less newbie I'd like to get some criticism on this new ...
  • 207
5 votes
3 answers
272 views

Class showing a format similar to var_dump RC5 Version

Some methods of this library require some improvements (see this description): In the constructor I am trying to create the possibility that the user modifies the ...
1 vote
2 answers
941 views

cout style logger in C++

Please review my ostream logger, ologger, which attempts to make logging as easy as using cout. The ostream operator<< is leveraged so that anything that can be logged to cout can be logged to ...
  • 2,289
5 votes
0 answers
453 views

Reading sensor data from serial device and publishing on MQTT

I have a weather station with a data logger which accepts commands (specified in user manual) and sends back the respective data over a serial interface. In my case, I want to read the current data ...
1 vote
1 answer
47 views

Logging conditionally repetitively in code

I am using Log4j2 for logging. Multiple operations return success code. If status 0 is received, it means operation is successful, else failed. If operation is ...
6 votes
2 answers
173 views

Error Code Stack Trace and Propagation Library in C

I've been programming in Go and I enjoy how easy it is to create descriptive errors and propagate them up the call stack. I wanted that sort of ease and consistency in C so I created a small error ...
  • 163
13 votes
3 answers
1k views

Logger module in C

I wrote a logger module in C, that is essentially a printf wrapper + some additional color coding: I'd like get feedback how I can improve performance and also use better coding style. Right now, I ...
  • 795
3 votes
2 answers
103 views

Java Logging with a file per root package

I have a set of classes across multiple packages, and I want any logging from within a single "com.name.root.xxx" package and all its child packages, to be logged to a different file. e.g: <...
4 votes
1 answer
1k views

Simple Logger in C++

I'm currently making a game using C++. I eventually needed a logger, but I wasn't satisfied with any of the existing solutions. After a while, I wrote my own header called log.h: ...
3 votes
3 answers
147 views

C Logging Function

I wrote this log function and it works but is there a better way to write into the file stream and console at the same time? ...
  • 79
1 vote
0 answers
147 views

ILogger with Delegate Callback

My code writes data and then receives data back. I want to log that this has happened, and I also want to inject a delegate so that I can get a callback to trace the data that is going in and out. ...
3 votes
1 answer
125 views

User details logging [closed]

I have written this logic for logging, but is getting replication for all fields (last name, DOB,city, state, ZIP, etc). Here only validation logic is going to differ, whereas logging functionality ...
  • 163
5 votes
2 answers
2k views

A simple error messaging and logging system via macro(s) in C++

I'm just trying to build a quick and crude error messaging system. It currently looks like this: ...
4 votes
2 answers
178 views

MongoDB connection manager

I wrote a class for some MongoDB operations. So far I'm self-taught and mostly I follow the style from already existing code at my workplace (a startup). We don't have a code-review culture, so I'm ...
5 votes
2 answers
643 views

C++ multithreading logger class

I have designed a logger class to log messages to a file. It uses an independent thread to log the messages save to a queue previously using the main thread. I want to receive reviews about it. ...
  • 237
2 votes
2 answers
151 views

Lock-free multi producer logging/profiling, multi file descriptors

I am developing (for fun) a Utilities & Logging library Can someone please help me to improve: Github link Pros Thread-safe, no mutex. Use lock-free ring buffer (the idea is inherited from ...
  • 121
1 vote
3 answers
340 views

Custom exception handling function or logging library?

I want to document every exception handled in my code and some states of the code when it works properly. What I've done is two functions, one that creates an 'error report' (function: ...
8 votes
3 answers
4k views

Custom Logger class

My custom Logger class works just fine. However, the class is not intended for making instances of. Because there is really no reason to make instances of my class, ...
2 votes
0 answers
77 views

Ruby script for automating software install on a brand new Linux OS

I have some scripts to automate software install, apply some configurations and so on after installing a new system. I used to have them as bash scripts but it was generally a poor idea. I have ...
5 votes
1 answer
973 views

Python logging - wrapper

I am new to writing utility functions. I wrote a python program to return a Python logger with custom settings. Please review this code and provide comments on how to improve it. I am looking for ...
6 votes
2 answers
249 views

Logger class (C++)

I wrote a simple logger class for my project. Some key points: The interface is heavily inspired by Java's logging libraries (you can tell from the getters/setters that I'm a Java programmer). In ...
  • 61
4 votes
1 answer
58 views

Compile SASS files in a directory via Gulp.js tasks, one of which produces logging output

If the default task is executed here, the file name to be compiled is passed to the argument of the CompileSass function. When ...
5 votes
3 answers
747 views

C++ logging class

I've created a simple C++ logging class. It outputs various loglevels, and adjusts output color accordingly. I'm interested in any tips to improve my coding style. I am especially concerned with my ...
  • 490
8 votes
1 answer
1k views

Minimal Python logging

I tend to include something like the following in small and medium-sized Python projects, either at the top of the executable or as logger.py: ...
  • 83
4 votes
2 answers
119 views

Simple timestamping filter in C

I wrote a simple timestamping filter that prepends each line with the UNIX timestamp in nanosecond precision as returned by clock_gettime, as well as the difference to the previous timestamp. ...
8 votes
1 answer
441 views

Operation logger

GitHub, NuGet This component traces execution in a logical order instead of chronological as everybody else :) For example, the following code: ...
  • 6,133
4 votes
3 answers
417 views

Process queued data in the background

Currently I'm writing something like a messaging or logging framework (I'm not really sure how you name something like that). There are different servers which have to be notified if something happens....
  • 141
5 votes
1 answer
124 views

Optimizing away log function calls depending on global log level

I am a member of a university team designing a nanosatellite. We decided to implement our own (more lite) logging library to use, instead of, say, Google's glog, <...
  • 53
2 votes
1 answer
637 views

Asp.net web API Nlog implementation with UnhandledExceptionHandler

I have an asp.net web api. I would like to log errors into a file. So I decided to use NLog. I already have UnhandledExceptionHandler so I added NLog as follows. I removed all the try/catch in order ...
2 votes
0 answers
38 views

Pattern for classes that provide logger objects

I need to log the activities of instances of a class. Code that uses the class should be able to disable the default class logger (which, by default, is initialized with a ...
1 vote
2 answers
753 views

Filter for logging http request parameters

I have written a filter that intercepts http calls and logs request parameters. ...
  • 271
3 votes
2 answers
242 views

Logger adapter with a configurable chain of responsibility of middlewares

I use my own logger adapter that collects data into a dictionary: public class Log : Dictionary<string, object> { } This is really all I have. I then pass ...
  • 43.9k

1
2 3 4 5
7