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

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.

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 ...
38
votes
7answers
11k views

Logging without Code Bloat

I was wondering if any of you know any best practices or design patterns so that I can have good logging in my programs without them looking messy or bloated. I am currently using C# and NLog, ...
37
votes
4answers
4k views

Someone thinks poorly of my server log parser

I have just been informed that the following code written by me is extremely poor. I have absolutely no idea why. It is memory efficient, and looks clean to me. But still the feedback is very poor. I ...
37
votes
1answer
1k views

Utility that decodes and logs UDP packets

I have written the following utility, as my first non-tutorial program in Go. The purpose of the utility is to connect to a torque/force sensor (aka load-cell) via UDP; to send an initialization ...
22
votes
3answers
3k views

Parsing log files of HearthStone: The log reading API

I'm still working on a parser that can parse log entries from a game called HearthStone, the overall idea is that it will read the log file live when the game is running, parses the log file and show ...
22
votes
1answer
2k views

Extensible logging

Whenever I need logging functionality in .net, I use a logging framework, such as NLog. Obviously there's no logging framework for vba, at least none that I know of. As much as I love using NLog, the ...
21
votes
2answers
30k views

Windows keylogger in C

I have had this keylogger code for a while now (a few years*), and I figured I would put it up for review. Here is what I would like reviewed (in order): Portability - right now, this program can ...
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 ...
16
votes
1answer
10k views

Scraping after login using Scrapy

I just finished a scraper in python using scrapy. The scraper logs in to a certain page and then scrapes a list of other pages using the authenticated session. It retrieves the title of these pages ...
14
votes
1answer
2k views

Ambient Context

What do you think about this way to make logging available across the application without passing log object around? Let’s say we have something which allows us to ...
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 ...
13
votes
1answer
282 views

Extensible logging - DatabaseLogger

Recently I wrote a logging API that features an ILogger interface. I wanted to extend my library with a DatabaseLogger ...
13
votes
1answer
166 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. ...
13
votes
1answer
2k views

Detecting UI thread hanging and logging stacktrace

I have an application that needs to always be responsive. I've written a class that is designed to monitor the UI thread. The goal is to provide useful information in the logs to be able to understand ...
12
votes
2answers
5k views

Logging strategy setup

I finally set up my logging infrastructure to work as desired, however I feel like I had to do quite a lot things just to fulfill a few requirements. Now I'm worried if my approach has major drawbacks,...
11
votes
3answers
655 views

Pretty way of keeping sensitive info out of a logged command string in Ruby?

I have a long command that I am building with shovels (<<), with the intention of eventually running system(command). I'd ...
11
votes
2answers
411 views

LogManager Tests

I should have started with this code. I wrote my logging API without writing unit tests, and since I recently wrote an automagic unit testing API I though I might as well go ahead and use it. So I ...
10
votes
2answers
1k views

Filtering log files from a server

I have made a program in Python to do a filter of log files from a server. What I would like is some guidance on how this code could be optimized, streamlined or 'short-handed' so my 'pythonic' ...
10
votes
1answer
1k views

Try-except decorator for classmethods

This question is related to the Cactus Text Game Engine. For easy error handling in Cactus, we've put together this small decorator. Essentially, the decorator wraps any class method in a ...
10
votes
1answer
103 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: ...
9
votes
2answers
6k views

Creating a better NSLog

So, generally when I write iOS code, I will start with a lot of calls to NSLog, which is a macro that with print the string you send it to the console. There's a ...
9
votes
1answer
5k views

Simple log writer class

I've written a simple log writing class. My code is also hosted on my Github. Specifically, I am looking for criticism on these items: Resource management. What is a more correct/safe way to ...
9
votes
1answer
503 views

Date range validation

The following code is ran when the user presses a button to generate a log file based on the date selected. The DatePicker has a restrictive selected date range of ...
9
votes
3answers
456 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 ...
8
votes
5answers
4k views

Custom Logging Class: Efficiency

I wrote a logging class for several of my applications, but I have noticed that it is fairly in-efficient. Can anyone suggest improvements? What I am looking for: Pointers on improving efficiency ...
8
votes
3answers
580 views

SQL trigger to log when employee records are updated

I am learning TSQL (SQL in general for that matter), and I wrote this trigger that inserts logs about updated employees into the tblEmployeeAudit table. When I was ...
8
votes
2answers
1k views

Overloading various logging methods

I got really tired of having this code in all of my classes and methods: ...
8
votes
1answer
166 views

Log sorting program

This is my first ever program written in Rust (after reading the book). It is small tool to sort all lines from stdin according to two criteria. First one is time ...
7
votes
3answers
4k views

A Simple, One-Page PHP Admin Login (with prepared SQL statements)

First off, I want mention that this code works well. This is more of a request for suggestions... We're attempting to program a one-page, recursive, token-based admin shell that is safe from ...
7
votes
1answer
814 views

Automatic flowchart generator

I wanted to see graphically what my programme was doing so I wrote this automatic flowchart generator: ...
7
votes
1answer
279 views

Periodically comparing the play count of two Last.FM users

There is some little program (using a Last.FM API wrapper) which gets the play count of 2 specific users every 5 minutes and appends the difference between these 2 numbers to log file. Can you review ...
7
votes
2answers
67 views

Monitor webserver accessibility inconsistencies

I have written a simple application to monitor whether a couple of Java EE 6 web applications deployed to Glassfish 3.1.2.2 are accessible. My intent is to demonstrate to our operations team that the ...
7
votes
2answers
189 views

A port of a simple logger

I'm looking at porting a simple logger I wrote a while back in Python to a language which would result in less runtime overhead from logging. As an informal benchmark, I try to log a message, ...
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-...
7
votes
2answers
4k views

Policy-based, variadic logger class in C++

I've been exploring design based around some of the more advanced C++11 features lately, and some of them are turning out to be rather useful for some projects I'm working on. One is this policy-based,...
7
votes
2answers
413 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. ...
7
votes
1answer
706 views

Converting stacktrace to string

I am just sharing the method that i am using to convert stacktrace to string. This stacktrace is then being used in AWS Lambda to log. There are two things i am mainly concerned about ...
7
votes
1answer
703 views

A modern and extensible C++14 logger

I recently wrote this C++ Logger API code for a game engine. It needs to be as fast as possible so I tried to postpone everything to compile-time using different template meta-programming tricks (for ...
7
votes
1answer
1k views

C++11 Logging Architecture

To create a Logging system for a larger application, I came up with the following draft. The log sinks aren't detailed yet, but the factory method for logger creation and a rough draft of the logger ...
7
votes
1answer
712 views

Simple, encapsulated C++ logger that can deal with fork/exec situations

Motivation: for whatever reason, some of the available 3rd party logging libraries don't really deal with programs that get fork'ed/exectuted well. For instance, ...
6
votes
3answers
26k views

Use of Exception to log execution stack trace

I've been back and forth with a colleague over the use of Throwable.fillInStackTrace. This Log class is meant to wrap the Simple ...
6
votes
2answers
181 views

Extensible Abstract Log Reader

My goal with the following code is to provide an extensible class that can be extended in order to read log files and transforms them into meaningful output. I'd like to have comments about the code ...
6
votes
2answers
4k 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 ...
6
votes
1answer
1k views

Logging object for C++

I've been always updating my log methods, because I started SDL and I needed some new methods. First, I made difference between debug and release, and so console and file. But now I want a more ...
6
votes
2answers
187 views

Bash log monitoring

I've made a Bash script to monitor some server log files for certain data and my method probably isn't the most efficient. One section specifically bugs me is that I have to write a newline to the ...
6
votes
2answers
817 views

Method/parameter tracer

I am writing a class which can log the activity of an application during run time. The plan is that the SupportMI string will be sent to a DB, from where I can use ...
6
votes
1answer
63 views

Fixing logs that overlap

Here we trying to fix logs that have overlaps with each other. Am I doing it right? Is there any way to improve/refactor it? ...
6
votes
2answers
1k views

Logger module in child processes from os.fork()

I have had a hard time understanding all the documentation on the logger module and forking processes. My goal is to have each child process that's worked to write to their own separate log file. ...
6
votes
1answer
63 views

Laser cutter daily reports parser

In my Python journey I was looking for a "real life" problem and I think I have found a good one at my current work. The laser CNC machine I'm working with generates reports that contains timings of ...
6
votes
1answer
377 views

Debug log wrapper

I will be adding functionality and most likely additional refactoring, however a stringent review would be welcome before I build it further. I know documentation is probably a bit sparse but, you ...