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
5
votes
1answer
4k views

C++ syslog wrapper

Some things I want to achieve with the logging code. Code is for an embedded device. Code must only work for Linux. C++11 can be used. Syslog daemon is running on the device. So I want to wrap syslog....
2
votes
0answers
423 views

Logging to file with size limit

This works, but there must be a better, more memory-efficient way to do it. log.Init checks to make sure log file exists, and creates it if it doesn't. It also ...
3
votes
1answer
86 views

Scraping metrics from log files

https://github.com/bodgix/log2metric/pull/1 This is my very first Go program so please forgive any beginner errors. This is a rewrite of a monitoring script I had written in Ruby. Coming from Ruby, ...
4
votes
1answer
115 views

Simple Python Logger

Here is a simple Python logger I would like some general feedback on. Features: Dynamically creates log folder and files wherever user runs the program Abillity to create multiple logs from a ...
8
votes
3answers
583 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 ...
4
votes
1answer
57 views

Daily Add/Del Git Log Analysis

I just finished writing this Python script to calculate daily additions and subtractions from my git log to use in making pretty graphs. This is a rewrite of something I wrote previously in Perl. I ...
1
vote
1answer
37 views

Logging observable values while extending service

I'm trying to extend a service function which returns an Observable<T>. The idea is to extend the function so I can add logging functionality whenever the ...
1
vote
0answers
41 views

Logging netflow connections based on IP address ranges and blacklists

Background and assumptions: A flow corresponds to a netflow record that is written into mongodb. Each flow record has a ...
4
votes
1answer
98 views

Reading event logs of several computers

This is my first PowerShell script. It reads the event logs of several computers in the local network and lists error/warning messages written to them in the last 24 hours, if any. I'll appreciate ...
0
votes
1answer
154 views

Powershell GetKeystate with outfile

I got a keylogger Powershell script to protocol my input, since I'm quite paranoid if someone uses my PC. However, some letters (I have an anti-ghosting keyboard) are swallowed if I type them in fast....
1
vote
1answer
960 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
552 views

Observable Logger

I'm experimenting with an alternative abstraction layer for logging that is build on top of the Reactive Extensions. This allows me to easily add features I need to my layer and map logs to any other ...
2
votes
2answers
93 views

Pulling data from a CSV and populate AD

I've been piecing this together little by little for a little over a week. I'm curious if there's a cleaner way to accomplish what this is doing. Basically, it's pulling data from a CSV, creating ...
6
votes
1answer
65 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 ...
4
votes
0answers
3k views

Logging in ASP.Net MVC project

I want to implement a Logger and use Serilog as Provider. My Project is ASP.NET MVC Framework (not core). Initially I tried to replicate ASP.Net Core Logging framework. I created a ...
1
vote
0answers
373 views

Simple AuditLog

I am using ADO.NET in my project and I want to have a simple AuditLog. I have below Codes for that but I wounder to know is ...
5
votes
1answer
349 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 ...
3
votes
2answers
792 views

Counting consecutive streaks in random numbers

I heard that when you toss a die often enough, you could get the value "one" a million times in a row. I am a beginner in Python 3 and I tried to write a little program that generates 1 or 2 randomly ...
0
votes
1answer
1k views

A method to log and display text in a console screen simultaneously.

I had always had the necessity to display long text outputs on the console screen. The size of the text displayed usually exceeds the amount of text that can be accessed by scrolling up through he ...
2
votes
1answer
266 views

Logging class in Qt library for foreign language calls

I have a small C++/Qt library that interfaces with an application in another language (so interfacing must be performed using primitives, notably pointers to Handler...
2
votes
3answers
238 views

Measuring time spent between two points in code

I'm working on a project where I'm instrumenting how long it takes to get from one point in my code to another. I've written an LLVM pass that instruments the IR with calls to a simple timing library ...
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 ...
0
votes
1answer
34 views

ES5 class to handle analytics fetching and caching

This class reads a log file stored on my server, parses it, and returns it. It also caches the data so that subsequent calls to get the analytics data will not have to read from the file. The ...
4
votes
1answer
136 views

Write a message to a log

I have started to read Robert C. Martin Clean Code book. To learn and gain more expreiences I wrote a single Log class. So I want some suggestions to improve this code.. This is a part of the Log ...
13
votes
1answer
3k 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 ...
7
votes
1answer
725 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 ...
4
votes
2answers
913 views

Scanning through logs (tail -f fashion) parsing and sending to a remote server

I have a task at hand to build a utility which Scans through a log file. Rolls over if a log file is reset. Scans through each line of the log file. Each line is sent to an executor service and ...
5
votes
0answers
171 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
1answer
532 views

Writing to rotating log file via channels

I'm an experienced programmer (mostly C#, JavaScript, PHP). Go is quite a paradigm shift and I want to make sure I'm starting on the right foot. This is my first Golang package. It's purpose is to be ...
3
votes
0answers
83 views

Restart a service and check its status

I have written this script to stop and start a specific service and check if it was able to load and unload applications tasks correctly, by checking a status in application log. Also it writes a log ...
10
votes
1answer
119 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: ...
2
votes
1answer
191 views

log and throw in dot net

I read a bit about log and throw and anti-pattern and so on, but I still not get exactly what's the problem. I'm using entity framework and I want to log every exception appearing with its complete ...
7
votes
2answers
190 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, ...
4
votes
0answers
8k views

Logging into Database with ASP.NET Core

In the Startup.cs of my ASP.NET Core application I want to configure the LoggingFactory so that it logs into the database. ...
1
vote
1answer
2k views

Web API Custom Error Logging

The goal of our application was to use the same custom logging we created for our ASP.NET MVC applications. We implemented a solution that used some of the techniques in ElmahExceptionLogger: ...
1
vote
2answers
70 views

Simplified LogService (from concurrency in practice) with shutdown feature

Brian Goetz provided following code of LogService with shutdown feature: ...
1
vote
1answer
176 views

Print log error and save it to a file

I have created a simple custom logger to print the error log and save it to a file with specific location. ...
2
votes
0answers
101 views

Function to log arguments and return value of any function in Clojure

I have implemented a function, which logs the inputs and outputs of any function, indenting the log based on the depth of the call stack: ...
2
votes
1answer
364 views

Database logger for ASP.NET Core

I have created a database logger for ASP:NET Core's logging API and I'd like to publish it on NuGet when ready. The GitHub repository is here. The library is partly modeled after Microsoft.Extensions....
1
vote
2answers
3k views

Simple Logging Class

I can coded a simple logging class in C#, my main aim for this is to make it easily usable, fast at logging and saving, and to handle pretty much everything that errors. Overall I am just looking for ...
2
votes
2answers
583 views

Custom log4net raising application-level events

Use Case: I have a form application in which I log events to a file/database and have a need to also raise those events to the application itself (for display purposes). Think old school updating ...
3
votes
1answer
2k views

Log4j Singleton

I'm trying to design and develop a singleton class that will handle resolution and configuration of log4j (not log4j2). The basic idea is to have a single class, reusable in any application, that ...
2
votes
0answers
107 views

Creating instances of a logger class for various logging levels

I provide a class to use but for convenience I want the class to implement some instance methods as static methods. This was fast and concise but it feels smelly, probably because I'm modifying the ...
4
votes
0answers
789 views

Passing a custom parameter through a logger

I have a custom logger which logs all messages at WARNING level and above to a Slack channel. Certain error messages occur so frequently that they make it hard to ...
1
vote
1answer
238 views

Monitoring errors with singleton

I need to monitor my functions for "errors" and want to print the warnings at the end of the functions. I thought using singleton class could be a good idea in here (code inspired by this example): <...
3
votes
0answers
526 views

Parsing simple log files in Julia vs Python

I wrote a log parser in Python and Julia. The Python version takes about 8 seconds to process 350 files, while the Julia version takes about 8 seconds to compile, after which it takes over 20 seconds ...
0
votes
1answer
100 views

Simple logger for a server

I wrote a simple logger for a server I'm writing. I'm wondering if anyone has any suggestions to improve it. doom_logger.erl ...
7
votes
1answer
791 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 ...
4
votes
1answer
2k views

Strip a newline and add more text to a Go bytes.Buffer

I wrote a little timer middleware to append the request duration to the end of the log message returned by the excellent Gorilla Toolkit's CombinedLoggingHandler ...
5
votes
2answers
182 views

Proper separation of concerns for stateful logger

This is a code review for a set of loggers following this question. The project is a universal windows application targeting Windows Phone. There are concerns over the tight coupling between the ...