Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

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.

3
votes
1answer
35 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
45 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 ...
1
vote
0answers
19 views

Refactor log4j2 properties file

I have the following log4j2.properties file: ...
3
votes
1answer
54 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 ...
4
votes
3answers
249 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 ...
0
votes
0answers
14 views

QTP/UFT Prints the time in takes to complete every task in a Log using VBScript

This script is meant to log the time it takes to complete functions in order to find the locations where performance could be improved in QTP. If a duplicate log is attempted, the script changes the ...
2
votes
0answers
40 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
76 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 ...
1
vote
1answer
757 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
117 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 ...
2
votes
0answers
119 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
793 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
314 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
145 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 ...
1
vote
1answer
54 views

Two approaches to Logging when Unit Testing with Python

Python allows logging to be used in several ways. What are the relative merits of these two approaches to Logging when Unit Testing with Python? Is one approach superior or does each approach suit ...
3
votes
2answers
7k 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
461 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
160 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
32 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 ...
0
votes
1answer
44 views

Logging util with static lambda function

So again, I am a bit confused about some notes that i'am getting from my reviewer. I have some kind of utils, to print/prepare log messages. Yea, maybe I am a bit fanatic java 8 lambda guy but I think ...
5
votes
2answers
93 views

Encoding and decoding log entries in a Lossy Binary Format

One of the projects I'm working on requires logging a huge amount of information (basically, every function call). The problem is obviously that logging a lot of information has a few side-effects, ...
2
votes
2answers
2k views

Log4net helper class for unit tests

The class helps to determine the exact output log message, taking in account the conversionPattern that log4net uses for layout. Current usage is you have to attach the listener, then call your BL or ...
2
votes
2answers
96 views

Processing lines in an event log to trace the status of a job

We have an event file which I'm processing to get the status of a job (process), whereas a single job contains multiple fields which I want to segregate based on what I required, for example, "...
4
votes
1answer
87 views

F# Idiomatic Log4Net Wrapper

I put together a log4net wrapper that more closely resembles F#-idiomatic logging functions. The basic idea is that there's a Log module that defines a set of 8 ...
4
votes
1answer
50 views

Simple server log backup script utilising AWS

I have server side log files written to various directories throughout the course of a week. I have the need to optionally compress, and archive these files to AWS. The script I have come up with ...
7
votes
1answer
3k views

Basic Linux daemon

I'm looking at writing a simple proxy. At the moment I've got a logger, command line argument parse and simple daemon (it does nothing beyond logging). Next I'll be looking at starting the network-...
2
votes
1answer
1k views

Dynamically Change Logging Level of a Python Process

The intention of following code is to dynamically change the logging level of a running python process that has imported this module. ...
5
votes
2answers
597 views

Format log with a small macro logger

The goal of this code is to format any log to STDOUT and STDERR with the file and the line of where the call is made. I took ...
3
votes
1answer
114 views

TaggedLogger - Log wrapper

I wrote this class in order to not having to write tag every time (because of code duplication and risk of typos). ...
13
votes
3answers
2k views

Custom error-logging

I'm writing a static class to log my application errors into a text file. I am planning on using this as a library on any application I intend to develop in the future. Please let me know how I can ...
5
votes
0answers
153 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 ...
48
votes
2answers
63k 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 ...
4
votes
1answer
187 views

Simple logger class in C# - Follow up

I've asked a question about this particular code before, although it was a little different back then. I took the suggestions from people who replied to my question and decided to post a follow up to ...
0
votes
1answer
359 views

Simple logger class in C#

I've been using logging libraries recently and somebody told me to try and write my own. I've kept it minimal but the only drawback is I can't log in static classes, due to TClass. Follow-up I'm ...
6
votes
0answers
130 views

Advanced Logging Function

Way more blood, sweat, and tears have went into this then I would care to admit, but this has been a function I have been using in some shape or form for quite a while and it has taught me alot. It ...
3
votes
1answer
625 views

Writing a log file with threads

Here are all the threads write the log file. I want to know if the below script is fine, if it needs any modifications, and whether I am utilising threads properly to execute this code quickly. <...
1
vote
0answers
53 views

Testable filesystem Writer for logging, with log rotation

I want to implement a custom Writer that allows the native go logger to do log rotation, and I also wanted to be able to write tests for it. The general idea was ...
1
vote
2answers
61 views

Middleware Django statistics

I have this middleware to log the number of queries, the time spent on each view and some errors and tracebacks. This will be called on each request, so I had to put a 75ms timeout. I don't like it, ...
2
votes
0answers
29 views

Websocket 'onmessage' logger to MongoDB

I'm learning websockets and wanted to make a websocket onmessage logger which writes the received data in a mongodb. I'm starting my script with ...
1
vote
0answers
23 views

Logs UI errors to a service provided in the configuration

As part of the project I am currently working on we want to log our UI component errors as well. I developed this package as a base. It's a factory (basically, not sure if it's correctly a factory). ...
6
votes
1answer
80 views

Pruning logs, burning the remains

After implementing some logging in my system, I got tired of digging through very long files trying to determine where specific runs started/stopped to look for differences, so I began adding a date/...
9
votes
3answers
449 views

C++ Threaded Logger

What is it? It's a fairly simple logger which utilises a thread. How it works Note: this a pretty terrible explanation, perhaps it would be easier to look at the code. The logger class is a ...
1
vote
1answer
109 views

PHP exercise to read or write database values

I just came up with the code below but I'm wondering if there is room for improvement? I.e. better readability and or performance, better structure, less lines of code? The script should parse a ...
7
votes
2answers
405 views

Small logging project

This is a pet project done as an exercise in C++. The following are currently out of the scope of my project but I am considering them. If you deem it important don't hesitate to comment on it. ...
5
votes
3answers
1k views

Several approaches to a logging class

I'm making a personal logger and so far I have come up with 3 solutions. I have them simplified in this example to highlight my dilemma. I want to know the pros and cons of my approaches and ways to ...
1
vote
0answers
48 views

Basic Java Android app for computer data logging in an SQLite database

This is a pretty basic app I made to collect data necessary for a separate project. However it's also my first go at doing any Android programming, so I know there's definitely issues with it (the ...
1
vote
1answer
102 views

Monkey-patching Jasmine's it() function to log errors

The introduction of async native support in Jasmine doesn't log the errors (i.e., specific line number where the error occurs) to the console. So, to get around this behavior and to make the errors ...
3
votes
1answer
254 views

NSLog-like logging framework for iOS

I am writing a logging framework for iOS. The idea is to create a behavior similar to NSLog to print the log message and some metadata to the console. The ...
13
votes
1answer
162 views

Logging library

Due to several limitations of the standard library's logging module, I wrote my own. Below are the most important parts. You can find the whole library here. Any feedback is welcome. ...