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.
7
votes
1answer
57 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
...
3
votes
2answers
147 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 ...
4
votes
0answers
66 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 ...
3
votes
1answer
63 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
44 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 ...
5
votes
0answers
33 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:
...
3
votes
1answer
62 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
140 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, ...
2
votes
0answers
371 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
120 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
49 views
Simplified LogService (from concurrency in practice) with shutdown feature
Brian Goetz provided following code of LogService with shutdown feature:
...
1
vote
1answer
37 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.
...
1
vote
0answers
31 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
173 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
493 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
91 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 ...
2
votes
1answer
190 views
Java - Log4j Singleton
First time on this community board. 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, ...
3
votes
0answers
38 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
61 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 ...
0
votes
1answer
42 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):
<...
4
votes
0answers
155 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 ...
2
votes
1answer
80 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
214 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 ...
5
votes
1answer
48 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
129 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
85 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
117 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 as its running. With the logging module I get timestamps and ...
2
votes
2answers
229 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:
...
8
votes
1answer
152 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 ...
1
vote
2answers
124 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
664 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
47 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
41 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
73 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
235 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
147 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
113 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
67 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
408 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 ...
4
votes
2answers
64 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
124 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:
...
13
votes
1answer
527 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
90 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
99 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__)) ...
3
votes
1answer
231 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, ...
4
votes
1answer
153 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 ...
2
votes
2answers
109 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
56 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
166 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
33 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 ...