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
2
votes
1answer
59 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
687 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
1answer
325 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 ...
7
votes
1answer
513 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 ...
4
votes
1answer
135 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 ...
1
vote
2answers
86 views

Filter for logging http request parameters

I have written a filter that intercepts http calls and logs request parameters. ...
5
votes
1answer
82 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
718 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 ...
5
votes
2answers
111 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
49 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
233 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
563 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
47 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
407 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
363 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
87 views

An asynchronous logger

I've written a simple asynchronous logger (playground): ...
3
votes
1answer
80 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
50 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, <...
3
votes
1answer
80 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
1answer
149 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 ...
6
votes
1answer
219 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 ...
2
votes
0answers
30 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 ...
2
votes
2answers
87 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
81 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
85 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
64 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
428 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
5k 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
72 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
vote
1answer
80 views

Two approaches to Logging when Unit Testing with Python

Python allows logging to be used in several ways. Can you review the relative merits of these two approaches to Logging when Unit Testing with Python? Is one approach appropriate to specific ...
5
votes
1answer
39 views

Analyzing a web access log to obtaining totals for requests

This program takes the filename as the input and outputs to a file the number of requests that were more than 1000 bytes and the total bytes. Log file example: ...
7
votes
2answers
6k views

Lightweight logging library in C

I want to get some practice in writing C libraries and so started with something I can use straight away, a logging library. It is very basic and only has two levels: log everything and log only ...
10
votes
1answer
125 views

Logging module for use in other projects

I'm trying to make a simple module I can paste into my various projects to provide basic logging capabilities. I'm hoping to become less dependent on print because: ...
3
votes
1answer
2k views

ASP.NET Core Request / Response logging middleware

I am looking for feedbacks about my ASP.NET Core Request / Response logging middleware, in particular in ways to lower the memory footprint and string allocations: ...
5
votes
1answer
383 views

Logging with decorators (passing log file name as argument)

This is for some quantum mechanics software so there will be references to molecules/atoms etc but the core issue is a python logging one, unrelated to all that. I have a couple of logging decorators,...
1
vote
0answers
25 views

Refactor log4j2 properties file

I have the following log4j2.properties file: ...
4
votes
1answer
60 views

Downloading attachments from web app

Preface This is my first work script; normally I'm just mucking around in console or writing snippets. This script has a lot of firsts for me (configs, logging instead of print, try/except). ...
17
votes
4answers
1k views

Sensor logger for Raspberry Pi in a stratospheric probe

I'm writing a Python Script for a Raspberry Pi to measure different sensors. We are planning to send the Pi with that Script running to the stratosphere, so the power usage for the Pi is limited. I ...
7
votes
3answers
5k views

Implementing a logging system in C++17

I've been programming for what is a probably a little bit and made a very simple logging system for my personal projects. While it works out fairly well so far, I would like advice on how to make it ...
2
votes
0answers
99 views

Python logging setup for a package

I'm running a package that downloads data from the internet. This package makes logging calls from different modules. Suppose I have a package 'demopackage'. Here is how my logging is currently set ...
0
votes
1answer
96 views

Fluent interface for Logger

I was trying to wrap a Logback logger in order to provide some handy methods and already defined default keys of the logged json output and I came up with something like this. Do you spot any ...
2
votes
0answers
440 views

Typescript logger class

Looking for a critique of this simple logger class I'm working on in my transition to TypeScript. The purpose of the logging class is to just print to a console either info, warn or error messages. ...
1
vote
1answer
2k views

Static wrapper class for log4net Logging - thread safety

I'm using log4net in my application and have a static Log class which creates an instance of ...
4
votes
2answers
316 views

Reading SQL query from a resource, with error logging

I've created a utility class that expects a logger to be passed at a method level, since I prefer legitimate errors to be written out for troubleshooting later on. Another developer hates passing the ...
1
vote
0answers
168 views

Stored procedure that adds row-level auditing to a table

I'm looking for any suggestions on how to improve my T-SQL for this procedure. It works okay, but I'd like to get advice to improve it from more experienced SQL developers. This procedure adds 4 ...
3
votes
2answers
8k views

Injectable logging with NLog and Ninject

I have been using NLog for logging purposes in my web applications, but it was not injectable. More precisely, each class using logging declared the logger like this: ...
4
votes
1answer
1k views

Error-Handling Class and Logging for VBA

I've been reusing an error class in Excel VBA projects for a few years now and I'd like to see if there are ways to improve it. Any suggestions for style, code, etc. are all welcome. The 2 ...
1
vote
1answer
324 views

Error-Handling Class and Logging

I am relatively new to C# and would like to see if what I have been using for my exception handling, message and logging is along industry standards. I have created a simple class for the Error ...
3
votes
0answers
35 views

Eassily create a logger in python for many modules with loglevel set according to command line arguments

I'm trying to learn writing python programs in a modular way as much as possible. One of the issues I've had difficulty to solve is parsing command line arguments (with ...

1 2 3 4 5 6