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
9
votes
3answers
620 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 ...
7
votes
2answers
618 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
2k 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
53 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
115 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 ...
4
votes
1answer
131 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 ...
13
votes
1answer
191 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. ...
3
votes
1answer
271 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 ...
0
votes
1answer
132 views

Java Logger code for create separate log for each app

I am trying to create logger wrapper which will be used by calling application installed on IBM WAS. Since I am using java util logger, I will have to add handlers for each logger programmatically. ...
1
vote
1answer
116 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 ...
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
504 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
93 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
130 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
584 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
42 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
99 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
170 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....
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
605 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
66 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
427 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
400 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
836 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
276 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
241 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
745 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
993 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 ...
6
votes
1answer
185 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
577 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
120 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
200 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
195 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
72 views

Simplified LogService (from concurrency in practice) with shutdown feature

Brian Goetz provided following code of LogService with shutdown feature: ...
1
vote
1answer
204 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
102 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
370 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
4k 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 ...