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
3
votes
0answers
85 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
127 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
215 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 ...
8
votes
2answers
204 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
10k 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
75 views

Simplified LogService (from concurrency in practice) with shutdown feature

Brian Goetz provided following code of LogService with shutdown feature: ...
1
vote
1answer
276 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
136 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
393 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 ...
2
votes
2answers
688 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
110 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
1k 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
357 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
587 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
104 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 ...
8
votes
1answer
1k 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
3k 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
204 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 ...
4
votes
1answer
619 views

Log file mechanism

I want to create a generic log file which I can easily reuse in multiple files. Also, I want to be able to use the versatile std::cout so I can easily write ...
4
votes
0answers
929 views

subprocess with logging module: tee with StringIO

I've got a long-running process. Once it finishes I need the output. But the user should be informed while it's running. With the logging module I get timestamps ...
2
votes
2answers
3k views

A generic logger in modern C++

I've created a simple logging system that I'm planning to use and I've tried out some modern C++ features to make it generic. First I've made a log class that represents a single log message: ...
9
votes
1answer
8k 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 ...
2
votes
2answers
306 views

Logging all API call traffic in Java servlets

We have a few servlets like the one below, taking JSON request and produce JSON response. And the requirement is to log all API call traffic. ...
1
vote
1answer
5k views

Spring AOP Log4j Logger example, improvement

I went through some of the stuffs on net regarding spring AOP and wrote a Spring AOP logger. Can you guys check my code and give your valuable inputs to improve it or if it is not proper, give me an ...
3
votes
0answers
223 views

Reading log file of subprocess

I run subprocesses with lot of output (compilation of Unity 3D projects). I use log parsers to find known issues. ...
4
votes
2answers
48 views

Process monitoring script

I wrote a script which logs memory usage of a process (pid in file), and reacts in case a limit is reached. I run the script nightly. In my case, the process concerned propably has a memory leak and ...
1
vote
1answer
84 views

Logging System - Follow Up

Previous question: C# Logging System I have took your answers on board and added the following changes to my LogManager.cs class: ...
3
votes
2answers
390 views

C# Logging System

I created a small logging class library and wanted you guys to check it out, I used to use Log4Net but thought I could create something more user friendly that was more suitable for my project than ...
8
votes
1answer
168 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 ...
2
votes
1answer
218 views

Arduino weather station logger

I made a program that uses the Adafruit pressure sensor, and the DHT22 temperature and humidity sensor to log pressure, temperature and humidity every 30 minutes. I left it outside my house overnight ...
1
vote
1answer
108 views

Android log in file for testing purpose

I have created a method which shows log in logcat and also writes into the file. Every time this method is called it appends String in file. There are so many read/write operations on disk/non-...
4
votes
4answers
549 views

Recurrence, recursive function

Type a number \$n\$. Then calculate \$f(n)\$, where $$ f(n) = \begin{cases} n-10 & \text{if}~ n > 100\\[1.5ex] f(f(n + 11)) & \text{otherwise} \end{cases} $$ The output must show all the ...
5
votes
2answers
453 views

Counting unique visitors in access log

I'm aware I am probably reinventing the wheel somewhat here, but I am trying to teach myself simple bash coding by completing simple tasks such as parsing files. To that end I am looking to learn ...
2
votes
1answer
749 views

Generating INSERT query from parameters

I use NLog everywhere and I really don't like writing the inserts everytime. You need to write the same variable three times: two for the insert and one for the parameter for example: ...
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 ...
2
votes
2answers
341 views

Simple logging library in C

This header implements a very simple set of C (only) functions for logging. This is part of a larger collection of utility functions aimed to be used during the development process, meaning that they ...
6
votes
1answer
240 views

Python logging handler

I'm working on a logger that has a name of the module that called the logger (when I create an instance of a logger in my program, I call LoggingHandler(__name__)) ...
2
votes
1answer
2k views

Class of file uploading to S3 using boto with multipart supported

I'm writing an app by Flask with a feature to upload large file to S3 and made a class to handle this. I have some targets in writing code: Code must be easy to understand and maintain. (Yes, ...
5
votes
1answer
2k views

Wrapper for Java logging

I am currently working on a new version of my application, and I just finished rebuilding the log part. It works well but I am skeptical about the choices I made. I am a student and I work alone in ...
3
votes
2answers
195 views

Logging errors and debug messages

I'm currently working on a small project that uses Java to handle a socket-based MMO browser game. I'm still at the beginning of the project and I'm currently writing a class that logs errors and ...
0
votes
1answer
59 views

SQL message logger run loop

I am learning Java by reading source code of other authors. This Java method handles communication with SQL database. While the code does work several things concern me. For instance the ...
0
votes
3answers
1k views

Overwriting native console.log function in JavaScript

I want to override the console.log function in order to save the data other scripts log. My script executes before any other script, so I have full control over the ...
2
votes
0answers
40 views

Grouping logs and providing counts

The code is supposed to group start and end time logs and provide log counts and unique ID counts. The grouping will be variable 1 hour, 6 hours, 12 hours, 24 hours, etc. What is the better way to ...
17
votes
1answer
13k 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 ...
5
votes
2answers
815 views

Splitting a CAN bus log in .asc format

I've written a quick script for a coworker to split a large CAN log into smaller chunks. (If you're not familiar with CAN, it's a communication protocol used by the ECUs in many cars.) I know where ...
3
votes
0answers
58 views

How to properly set a different formatter for a specific logger's child?

For certain modules or functions, I want to have a different format for the logged messages. I have done this in a way that looks a bit hacky: I have set a special Logger, containing a special Handler,...
3
votes
0answers
668 views

AngularJS client side logging in a MVC web application

Being a newbie into AngularJS, I have overlooked the importance of client side logging until some non-reproducible client-side errors occurred and I realized that they were not logged. My web ...