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
3
votes
4answers
1k views

Implementing a thread safe log class with simple functionality

I have finally assembled an attempt to create a thread safe logging class and also ensured by file flags that file should not be accessed by different processes at same time. This classed will be ...
8
votes
1answer
298 views

CIS 194 Homework 2: Parsing an error log

Here is another reference solution, that I discovered after writing my own: https://insight.io/github.com/beloglazov/haskell-course/blob/HEAD/hw2.hs I am following this lecture course as a ...
3
votes
2answers
126 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 ...
5
votes
3answers
239 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 ...
3
votes
1answer
111 views

Deleting millions of logs in batches

I have a fast growing table with logs that I frequently have to delete (the server doesn't have much resources). It grows by at least two million entries every day. The database is a SQL Server 2012. ...
2
votes
2answers
270 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 ...
6
votes
1answer
156 views

State logger for optimization problems

I am working on a C++ project for solving a class of optimization problems. The project will be header-only, and for now, I would like to stay with C++11 (so, not fold-expressions). To be able to ...
4
votes
0answers
105 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
1answer
44 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
2answers
71 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 ...
14
votes
3answers
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 ...
2
votes
1answer
348 views

Custom error handler for PHP

I've written a custom Error handler for use in PHP. What it does is simply capture PHP errors, and logs them using Monolog. It works, but I can't help that it has too much stuff inside. I could ...
3
votes
2answers
81 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
1answer
136 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
3answers
120 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? ...
1
vote
0answers
58 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. ...
2
votes
0answers
128 views

Determine the country by an IP

EDIT: I have updated the code, if you have comments about the previous version of the code, please do post them anyway. The task is to determine the country by an IP. Provided programme queries two ...
3
votes
1answer
122 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 ...
5
votes
2answers
881 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
2answers
121 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 ...
4
votes
2answers
206 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. ...
61
votes
2answers
79k views

Redirecting subprocesses' output (stdout and stderr) to the logging module

I'm working on a Python script and I was searching for a method to redirect stdout and stderr of a subprocess to the logging ...
2
votes
2answers
99 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 ...
1
vote
3answers
64 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: ...
2
votes
0answers
65 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 ...
8
votes
3answers
2k 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, ...
7
votes
1answer
677 views

Advanced Python logging system

I've been writing Python for years, but I've only just started using it in bigger programs than just simple server scripts. This means I now also want to use a more advanced logging system. To make ...
1
vote
2answers
344 views

Filter for logging http request parameters

I have written a filter that intercepts http calls and logs request parameters. ...
5
votes
1answer
474 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 ...
2
votes
1answer
1k views

Include Serilog sink requiring dependency before dependency injection in .NET Core

Here is a rundown of the situation This is a .Net Core (2.1) application with a console and web front ends. For simplicity this question focuses only on the console end although the web end has the ...
6
votes
2answers
146 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 ...
4
votes
1answer
53 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
3answers
344 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 ...
8
votes
1answer
673 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: ...
4
votes
2answers
81 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
1answer
432 views

Operation logger

GitHub, NuGet This component traces execution in a logical order instead of chronological as everybody else :) For example, the following code: ...
4
votes
3answers
381 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....
3
votes
1answer
115 views

An asynchronous logger

I've written a simple asynchronous logger (playground): ...
4
votes
1answer
124 views

Powershell - Simplified Logging

Today I have dealt with logging in PowerShell as well as with the different streams and the pipeline. Unfortunately, none of these solutions really met my needs. My requirements are: I need to ...
2
votes
1answer
1k views

Async time logging in multithread application

I have a simple producer-consumer multhithread application, I am trying to measure a few points in both threads for benchmarking. What I came up with is the TPL dataflow library of .Net, and I have ...
4
votes
1answer
79 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, <...
2
votes
1answer
451 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
0answers
31 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 ...
3
votes
2answers
152 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 ...
6
votes
2answers
90 views

Would log4j be more efficient to utilize than the logger I implemented (Code Below)?

I recently made a logger program implementation in my game engine. Which logs any thing that I send it in either a file or the System.out printstream. I use it like this: ...
4
votes
0answers
120 views

Type & Thread-safe Logger Implementation

So I had previously posted this question and asked for some feedback regarding my (now) header-only logging system and figured it would be a good time to go back to the changes I made it and see if it ...
4
votes
1answer
67 views

Python log entry search utility

I wrote a small utility for searching our web app log files for certain strings. The idea is that if the search string is found somewhere in the entry, the entire entry should be printed. The ...
11
votes
1answer
1k views

Simple log rotation script

I created a simple script that implements log rotation. It checks the log file size (say, out.log) if it exceeds 5MB limit. If it does then the script copies it to <...
28
votes
5answers
7k views

C++ logging library

I am creating a logging library in C++, and I wanted your opinion on code quality and performance within some methods. You may ask why yet another logger - the answer is simple. This logging library ...
4
votes
2answers
167 views

Python logging-module that writes to both the console and a file

I've created a small module with a function plog() that allows to easily print to both a log file and the console. It also creates a directory "log" at the location ...

1
2 3 4 5
7