Click here to Skip to main content
15,900,816 members
Everything / Logging

Logging

logging

Great Reads

by Sacha Barber
Azure Service Fabric Demo + IOC, logging, encryption
by V.
Second article on creating a reusable framework
by Mark Pelf
In this article, we build a practical reusable Logging Proxy in C#
by Greg Utas
No breakpoints or drooling all over the console!

Latest Articles

by Lance Ford
A walkthrough to enable request/response logging to an ASP.NET web application (or web service) by using an IIS module.
by Ivan Yakimov
A look at the issue of growing log volume in production systems by introducing the concept of a block of log entries
by Illya Reznykov
The post describes PowerShell script which creates WAF resources for the scenario when Application Load Balancer is used to serve content for a public website, but to block requests from attackers and to protect from OWASP Top 10 security risks.
by MSBassSinger
Description of a simple, versatile, and scalable logger

All Articles

Sort by Updated

Logging 

12 Jan 2024 by Lance Ford
A walkthrough to enable request/response logging to an ASP.NET web application (or web service) by using an IIS module.
28 Dec 2023 by Ivan Yakimov
A look at the issue of growing log volume in production systems by introducing the concept of a block of log entries
24 Nov 2023 by PinkGoat_
So I have a button made from my xaml file (view), called Export. When the user clicks on it, the logs created during the run of the app get exported to Logs.txt. If there are Warnings, Errors or Exceptions, those will instead be created in...
24 Nov 2023 by Graeme_Grant
The best solution, IMHO, would be to create a custom log provider. You can then handle the logging as the log entries are added. I wrote an article for a custom Log Viewer control that has a custom Log Provider, one for each of the 4 common...
23 Nov 2023 by Richard MacCutchan
See my comment to your duplicate of this question.
23 Nov 2023 by PinkGoat_
I'm having some issues here. So I wrote this method in a class named MainWindow, that exports logs of an app to a txt. Honestly I dont know if its good but anyways we will see. public void exportLogs () { string logsFolder =...
24 Sep 2022 by Illya Reznykov
The post describes PowerShell script which creates WAF resources for the scenario when Application Load Balancer is used to serve content for a public website, but to block requests from attackers and to protect from OWASP Top 10 security risks.
21 Aug 2022 by MSBassSinger
Description of a simple, versatile, and scalable logger
29 Jul 2022 by DiponRoy
Generate and store logs using middleware
9 May 2022 by Brandon Ontama
I'm trying to create a multi user login system but when I try to log on it doesn't work and simply stays on the same page.What can I do? index.php
9 May 2022 by Mark Pelf
In this article, we build a practical reusable Logging Proxy in C#
10 Mar 2022 by Greg Utas
No breakpoints or drooling all over the console!
28 Feb 2022 by Utku Ozan ÇANKAYA
Basics of improving WCF service quality
21 Feb 2022 by Illya Reznykov
Creating Regional Web ACL with CloudFormation
26 Nov 2021 by Member 15435322
Hi all, seroisly I am getting problem, which the only thing I want is a log4j2 configuration file, every time we switch to a new day, I want it to create a new file and print the logging messages there. If anyone here has the configuration file I...
26 Nov 2021 by Richard MacCutchan
See Configuring Log4j2 in Spring Boot applications - Masterspringboot -[^]
14 Nov 2021 by ehaerim
I am learning how to use Windows event logging service. MSDN: RegisterEventSourceA function (winbase.h) - Win32 apps | Microsoft Docs[^] Eventlog Key - Win32 apps | Microsoft Docs HANDLE RegisterEventSourceA( [in] LPCSTR lpUNCServerName, ...
14 Nov 2021 by Richard MacCutchan
Quote: Among those 3 App1 subkeys, which App1 will be matched to return its handle to hEvtSrc? The first one under the Eventlog key will be the default. If you wish to access either of the others then you will need to use MyCustLog\App1 or...
21 Aug 2021 by freedeveloper
Use the logger system as other Microservices in your eco-system
15 Jun 2021 by Member 11568448
I need to modify specific property value (compress stacktrace property of exception) of object logged using serilog. public class CustomEnricher : ILogEventEnricher { public void Enrich(LogEvent logEvent, ILogEventPropertyFactory...
5 May 2021 by ekonapikin1990
Hi all, I have a test written in java script that produces a large amount of console outputs. passed and failed scenarios I just want the FAILED "SCENARIO# FAILED" TO DISPLAY AND "SCENARIO# PASSED" NOT TO Because I want to save this failed...
5 May 2021 by ekonapikin1990
Figured out my own question Just needed to change console.log()==> disableLogger(); logger.disableLogger(); console.log(exampleof_passedscenario); Changed console log(); logger.disableLogger(exampleof_passedscenario);
1 Apr 2021 by the_nanometer
I am learning by myself how to use node js express and pino for logger, but What should I do if the logger throws an error? This is my example. What I have tried: const express = require("express"); const pino = require("pino"); const...
2 Feb 2021 by Jochen Scharr
A simple but robust logging class
12 Jan 2021 by Alexander Schichmanter
Concept, Motivation and Implementation of Dynamic Logging - a valuable aid to the C++ programmer
30 Dec 2020 by Member 10622146
I was wondering if someone can show me some good references in logging user activity in a winform application. I would like to log when the user logs in, when the user does certain tasks, submits data into the database, etc...I would like to log the activity either in SQL database or just in...
23 Oct 2020 by Gerry Schmitz
What does "Login" have to do with "making records easier to find"? Switching Tabs fires loaded and unloaded events; your solution has side effects and is "unconventional". Use a "wizard" pattern or enable a (control) panel on success.
23 Oct 2020 by RomanDyack
Hi to you all. So I made an application that succesfully records my mouse movement to a log file. Now, I'd like to organise my application a bit more by adding Login section, so the records later could be easier to find. I made this as a first...
4 Oct 2020 by Zijian
How to use Trace and TraceSource in .NET Core Logging
12 Aug 2020 by Sreejith Gopinathan
Error logging in ASP.NET Core Application with NLog
6 Jul 2020 by khaled Ezzat Abdelfattah Abdelgawad
While setting everything for Serilog and SEQ I was stuck in an issue that you may have an answer for it. I am trying to add some properties to all logs using LogContext.PushProperty. However, in my middleware (see image below) the LogContext can...
25 Jun 2020 by Code Artist
A reusable Windows Form text box control for capturing DEBUG and TRACE output
25 May 2020 by Daan Acohen
The HttpClient can cause a security issue depending on how it is used so this article explains how to prevent that.
23 May 2020 by Toby Patke
Clearcove.Logging is a very simple logging library designed to meet most logging needs with straight-forward licensing terms.
4 Feb 2020 by phil.o
This SO post: How to change maven logging level to display only warning and errors? - Stack Overflow[^] seems to embrace the subject pretty well.
4 Feb 2020 by Member 10777201
Working with a Maven web project and using Apache CXF(3.1.15) for RESTful web services with Apache tomcat 8.5. Whenever any API is hit just after server startup, Apache CXF lists out all the endpoints of the Services present in the CXF file as below: Below is the example of log messages: INFO:...
15 Jan 2020 by VulfL
Rules of thumb to write useful and readable logs in software system
14 Jul 2019 by Dave Kreskowiak
Did you add Project A as a reference in Project B? Did you put all of the configuration information required for Log4Net into the App.Config file of Project B? When you make an .EXE a reference in another project, you're treating the .EXE as a .DLL. It does not run as it's own separate process....
14 Jul 2019 by DevCodeproject1
I have 2 Console Projects Proj A, Proj B in one Solution and I am using log4net for Proj A and I am calling the Method in Proj A from Proj B What I have tried: I have tried changes the configuration in the Assembly file but no use
25 Feb 2019 by shayshabshay
In this tutorial, we will see an example of JSON format logging with Microsoft Enterprise logging, sending the logs to elasticsearch with Filebeat and use Kibana to view our logs.
1 Feb 2019 by Ivan Yakimov
Here, I'll describe how you can set the separate log level for each request to a Web application.
28 Nov 2018 by Shai Cohen
By utilizing some fairly mundane features of .NET, we can log errors at the point where the exception occurred; preserving vital debug information while avoiding repetitive error logging.
11 Nov 2018 by Sampath K10
Hi, Am working on an existing Project and they are using CODE.Framework.Core.Utilities to log the exception but I didn't see any configuration in web.config file to see where this exceptions logging. I would like to know where I can see the log. LoggingMediator.Log("Exception #####()::",...
20 Sep 2018 by soft.narayan
Hi I am using below log4.net for log in DB but issue here is i want to use encrypted password instead of plain text , if i will use encrypt password how and where decrypt so that it will logs in DB. I have decrypt logic code part. In General in .net we are keeping encrypt password in web.config...
18 Aug 2018 by Adityakumar2318
I am trying to log the error in database using log4Net in Asp.Net Core 2.0 but it seems that log4Net is not fully supportable till now. I have checked it on official site(log4net[^]) too. What I have tried: Log4net for .Net Core 2.0 – Rizk Hanna[^] I have tried above link and its writing the...
7 Aug 2018 by Zoltán Zörgő
Presentation of a simple library supporting use of NLog with LinqPad
19 Jul 2018 by Jochen Arndt
You did not specified what kind of tool or programming language you want to use. Tools There are multiple tools to view log files. Just search the web for something like "log file viewer" or "log file analyzer". Programming language Process the log file line by line. This can be done while...
19 Jul 2018 by Soma Sundar
I want to display all the logs in the computer for the given period of time in apache tomcat webpage display the logs from start time to end time which should be got from the user What I have tried: I did know what to do please help me I am just starting with tomcat and log files
3 Jul 2018 by Ivan Yakimov
When you write messages to your logs, sometimes it may be useful to add context information. For example, if you write information about some error, you could also include input data in some form, to be able to reproduce the problem easily. Here, I'll show how to gather this additional information.
16 Jun 2018 by Member 13875276
Hello. I have a problem with my java script. When i try to login in first it shows "Loading Data" than a huge dot (something like progress bar) and it doesn't login in. package com.example.test.test; import android.app.ProgressDialog; import android.content.Intent; import android.os.AsyncTask;...
11 Jun 2018 by Member 10481957
Chronological Expressions is a RegEx inspired Pattern Matching Library and Specification for query event logs
24 May 2018 by Sayan Bera
"C:/MyDevelopment/readfiles/fy...
24 May 2018 by Ramiien
I am trying to read data from Multiple .txt files in Qt. This how I am doing itvoid MainWindow::on_pushButton_3_clicked(){ QString path = "C:/MyDevelopment/readfiles"; QDir dir(path); QStringList filters; filters
16 Apr 2018 by Valerii Tereshchenko
Example of implementing logging using Aspect Oriented approach with DispatchProxy class
23 Jan 2018 by justin1204
I am trying a sample in mfc where i need to read the event logs and get the information from that logs in a string format. How do i read event logs out of the system and present the strings out of the event logs. What I have tried: i tried something like OpenEventLog and ReadEventLog
23 Jan 2018 by Richard MacCutchan
Those are the correct functions to get event log records. Each record is structured as described in EVENTLOGRECORD structure (Windows)[^].
28 Dec 2017 by Kunal Ved
Hi, I have an mysql script (test.sql) which I run from the batch(all.bat) test.sql looks like CREATE TABLE Persons111 ( PersonID int, LastName varchar(255), FirstName varchar(255), Address varchar(255), City int ); CREATE TABLE City( City_Id int, Name...
16 Dec 2017 by Biswal Tanmaya
This blog post discusses the importance of logging in MySQL
12 Dec 2017 by Valerii Tereshchenko
Example of implementing logging using RealProxy class
29 Nov 2017 by Sacha Barber
Azure Service Fabric Demo + IOC, logging, encryption
26 Nov 2017 by Juan G. Carmona
Proper logging in .NET Core 2 Console App
6 May 2017 by Habibur Rony
This topic will cover the concept of the adapter pattern & how to implement logger using log4net. It will also cover what’s adapter pattern, why need, where & when to use; what’s Log4Net, implementation of logger using adapter pattern, how to implement and add custom SMTP appender & configuration.
2 May 2017 by TVS1309
My Code is bellow.... public ActionResult Login(user model, string returnUrl="/Home") { if (ModelState.IsValid && WebSecurity.Login(model.UserFirstName, model.Password)) { return RedirectToLocal(returnUrl); } // If we got...
2 May 2017 by Abhishek Prakash Dixit
Use [InitializeSimplemembership] above the controllername means [InitializeSimplemembership] /// Here your controller starts
14 Apr 2017 by Homero Rivera
You mentioned 60~70 request created at moment is that per second? If installed on a powerful enough mcachine, SQL Server is good enough. However we need to think a little 'out of the box' and stop worrying about a logging problem, and start think about a pure SQL Server efficiency problem. ...
14 Apr 2017 by AhmedYehiaK
Hi everyone, I have a web API which communicate with multiple external services (SOAP, REST, etc) all requests to external services are in parallel (60~70 request created at moment) i need to now what is the best practice to log all requests and responses. I need to now the best method in...
1 Apr 2017 by Marco Bertschi
This tip presents an easy way of verbosely converting an exception and its inner exceptions to a string in order to get access to all details.
1 Apr 2017 by Daniele Fontani, keggyy
In this article, we explain how to build a simple and easy to use log platform, keeping in mind performance ad security.
20 Mar 2017 by Chandrakant Mane
Some popular error loggers are Log4Net[^]Elmah[^]
20 Mar 2017 by Aqeel Shoukat
I have developed a website in c#, its working fine. I just want to log all the activities and errors of my website. I am having difficulties to use log4net as I have to log Asp.net website not a web application and cant find the global.asax file in my website which is required to configure...
16 Jan 2017 by Bob Crowley
Custom Serilog Sink Development
9 Jan 2017 by Sem Shekhovtsov
This article describes how to integrate simple error logger for .Net Core MVC 1.0 web project.
9 Jan 2017 by rohanpatelce
Hello srikanth,For configure email in elmah add below code in web.config
22 Dec 2016 by Member 12903437
While logging using BOOST in task manager the size of memory keeps on increasing it does not delete it. For example if I print 6000 * 24 times the size of .exe(memory) in task manager is increased till the time its logged. Is there any way to free up the memory for boost. using BOOST_LOG_SEV for...
22 Dec 2016 by KarstenK
Detecting memory leaks isnt easy, so you need some tools if you really want to do it. I would try at first to contact some people with deep boost knowledege.Sometimes the task manager is fooling at the first look. Read here how to find memory leaks. And if you want to dig deeper you may find...
10 Dec 2016 by Member 11670657
Hi all friends,I have a sql store precedure called MakeLogging to log errors.I use try catch in my script and within that catch i have called MakeLogging sp as below.But is give me error, please help me to solve this.DECLARE @return_value int EXEC @return_value =...
10 Dec 2016 by #realJSOP
Why don't you have the query that threw the error log it instead of making the app do it?
10 Dec 2016 by Wendelius
If I understand the situation correctly, you need to catch the error and place information from that error to variables which you then again pass to the procedure (or use the values directly).For example you now try to pass ERROR_NUMBER to the procedure, but it isn't a variable or a...
3 Dec 2016 by Member 12726636
These days I have tried to know Windows 10 credential providers(cp).And I downloaded V2 Credential Provider Sample from Microsoft homepage.(you can easily find this at google, "Windows 8 V2 Credential Provider Sample in C++ for Visual Studio 2012" )I knew this sample code was made for...
3 Dec 2016 by Arthur V. Ratz
Windows 10 has the different credentials provider.Check if there's version of credentials provider exactly for Windows 10
29 Nov 2016 by H.AL
I have created manually my logging method to log some web-methods inputs in my soap web service created on visual 2010 vb.net. As my webservice will be accessed by multiple users I have thought of lock method that locks each time the log-file. But I faced a big issue: when multiple clients...
7 Oct 2016 by Stefano12777606
How-to setup log4net logging tool, create different objects configured to store their own logs in their own log directory and zip older logs
6 Oct 2016 by _PitrakSarkar_
Hi,I am trying to create my own eventviewer. I am doing it in C#.I got that the eventlog description is comprised of two parts. First the Message Templates that comes from the mc files of the logging application. It contains optional placeholder strings(%1, %2... %n) which is then...
3 Oct 2016 by H.AL
I need to add a method to my webservice that creates automatically a new log.xml file instead of creating it manually. I am working on visual studio 2010 with vb.net and soap webservice. I need to know where I have to add this method as it is not a webmethod?any help is appreciatedWhat I...
3 Oct 2016 by David_Wimbley
Your question is very vague. If you need to create an XML file, this functionality is very well documented.create XML file vb.net - Google Search[^]Simply add a web method if you need one to your webservice to do this. If that is not a possibility, create a new class that generates log...
30 Aug 2016 by super_user
i create login_class in that class i code this public void loginfu(string username,string password) { try { Entities2 lg = new Entities2(); List gr = lg.SP_GetL(username, password).ToList(); DataTable dt =...
30 Aug 2016 by OriginalGriff
That's a fairly simple error to locate, if you have the code - which we don't.It's a compiler error and it's coming because you have tried to do something like this:private void MyMethod() { ... }...var x = MyMethod().DoSomething();Because MyMethod is defined as returning a void - i.e....
30 Aug 2016 by Mehdi Gholam
You have defined loginfunction() to return bool not a DataTable hence the error on line :...string logn = Convert.ToString(lg_class.loginfunction(UserName, Password).Tables[0].Rows[0]["id"]);...
29 Aug 2016 by ErrCode
Hi,At first I had code to programmatically setup logging via Microsoft's Enterprise Library 6 and it used AsynchronousTraceListenerWrapper around a RollingFlatFileTraceListener. Something like this:var logFormatter = new TextFormatter("{timestamp} {message}");var...
19 Jul 2016 by G3Coder
The quickest would be to instantiate your Guid outside of your methods and re-use it. I suggest some more reading on the basics though. Since your update includes mention of a different clients you need to provide more detail of the system. Maybe you could pass the Guid around through the...
19 Jul 2016 by tnkarthi
I want to use common trace id. I'm using following code. public void method1(){ using (new Tracer(Guid.NewGuid().ToString())) { //my code } } public void method2(){ using (new Tracer(Guid.NewGuid().ToString())) { //my code ...
6 Jul 2016 by mcondon013
Message Logging Code Library routines allow you to output messages from your application to a text window, a text file or a Windows Event Log.
29 Jun 2016 by Member 7967542
Hi,I want to rollback transaction partially. Actually I have a procedure which does some tasks. I want to log the state of on each step. For this want to insert a row in the log table. In case of any exception I want to know how many steps are executed completely and on which step exception...
29 Jun 2016 by OriginalGriff
You can't rollback "part" of a transaction - it's all or nothing.Even if you nest transactions, inner level COMMIT instructions are ignored, and inner level ROLLBACK will cause an error: Nesting Transactions[^]To insert a log entry which won't be rolled back regardless of the transaction is...
10 Apr 2016 by Mane Priyanka
Enterprise Library Logging in Azure Database
7 Mar 2016 by John Torjo
You can easily apply Pretty Formatting to your logs. Make the information that's relevant to you easily stand out!
10 Feb 2016 by Kouji Matsui
This library is simple and is a substitution of System.String.Format.
8 Feb 2016 by Dholakiya Ankit
Logging database operations in Entity Framework and handling Exceptions