Click here to Skip to main content
15,885,985 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 Score

Logging 

29 Nov 2017 by Sacha Barber
Azure Service Fabric Demo + IOC, logging, encryption
1 Apr 2014 by V.
Second article on creating a reusable framework
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!
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.
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
4 Oct 2020 by Zijian
How to use Trace and TraceSource in .NET Core Logging
12 Nov 2012 by Severin Friede
This article should help you building log4cxx with Visual Studio 2010
21 Aug 2022 by MSBassSinger
Description of a simple, versatile, and scalable logger
7 Aug 2018 by Zoltán Zörgő
Presentation of a simple library supporting use of NLog with LinqPad
26 May 2013 by Jan_Zimmermann
A log4Net appender with a selfHosting SignalR server.
15 Sep 2012 by Sebastian Solnica
How to diagnose ADO.NET with ETW traces
1 Oct 2012 by Richard MacCutchan
You seem to be struggling with some of the basic concepts here and getting a bit confused about what needs to be done. There is no need to keep copying data from one place to another just so you can write it out. Try something like:char szDateTime[12];int recordLength = 138; // this...
11 Nov 2014 by Dave Clemmer
Using the Microsoft patterns and practices Semantic Logging Application Block (SLAB) to both structure your logging information and decouple how you choose to log from your application code that initiates logging related events. Plus, a Loggly listener is included that you can use to log messages.
11 Jun 2018 by Member 10481957
Chronological Expressions is a RegEx inspired Pattern Matching Library and Specification for query event logs
21 Aug 2021 by freedeveloper
Use the logger system as other Microservices in your eco-system
29 Jul 2022 by DiponRoy
Generate and store logs using middleware
30 Aug 2012 by Alexander Golde
This post will show you how to create a Logfile viewer in 15 minutes.
18 Sep 2012 by Alexander Golde
This post will show you how to create a Logfile Viewer in 15 minutes
22 Nov 2012 by Sebastian Solnica
NLog LayoutRenderer for Assembly Version
3 Jul 2014 by Sergey Alexandrovich Kryukov
First of all, you should put UI code in proper order: instead of handling all those buttons and text boxes on ad-hoc basis normally offered by the Designer. Instead, you need to abstract out the set of centralized actions which are called on raw control events, such as button click, text change...
6 Nov 2015 by Jochen Arndt
Qt provides the QFile[^] class that can be used with together with the QTextStream[^] class .But it is not really necessary to use the Qt classes. You can just use the C or C++ standard library file I/O functions to create a file or open an existing one and write to it.To write formatted...
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...
25 Jun 2020 by Code Artist
A reusable Windows Form text box control for capturing DEBUG and TRACE output
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...
25 Jul 2012 by Richard MacCutchan
You should be able to use the syslog(3)[^] calls without the need to change any system configuration.
1 Oct 2012 by Richard MacCutchan
The issue is that you are not writing binary data, you are writing character strings. You need to use the fwrite()[^] function to write the data, so you are sure that you write any bytes following a null byte.
1 Oct 2012 by Espen Harlinn
Have a look at: ACE_Log_Msg[^]The whole thing can be downloaded from here[^] Best regardsEspen Harlinn
24 Mar 2013 by Sebastian Solnica
How to make elmah.axd
27 Mar 2013 by Prasad Khandekar
Hello,No, it can not be used as a application monitoring tool. NXLOG is a universal log collector and forwarder. Although when run in server mode application can route the log information to NXLog instance via syslog. For application monitoring you may want to try Hyperic Application &...
9 Jan 2014 by MAbubakar.Riaz
hi i only need three thingspackage start time,package ending time andnumbers of rows generated,package start and end time was recorded by jst enabling logging with SSIS Log Provider for SQL Server and in details events; i selected nothing.now i want to add column or row that...
21 Apr 2015 by Richard Deeming
Your code is calling:MyEvtLog.WriteEntry(Source, LogDataEntry, EventLogEntryType.Information, 0)Looking at the variable types, that's the WriteEntry(String, String, EventLogEntryType, Int32)[^] overload, which is a static (Shared) method.You probably meant to call the...
20 Jun 2015 by Mathew Soji
try the solution suggested below.http://www.whatibroke.com/?p=882[^]http://stackoverflow.com/questions/17839032/you-must-call-the-websecurity-initializedatabaseconnection-method-before-you-c[^]
18 Aug 2015 by CHill60
Explanation has been given on your other post Can someone kindly tell me the logic behind the program?[^]Please don't post a question more than once.
30 Aug 2015 by chainerlt
private Thread _loggerThread;private readonly object _lockLoggerThread = new object();private void StartLogging(){ StopLogging(); var thread = new Thread(() => { try { var end = DateTime.Now.AddHours(8); while (DateTime.Now
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...
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....
16 Jan 2017 by Bob Crowley
Custom Serilog Sink Development
12 Aug 2020 by Sreejith Gopinathan
Error logging in ASP.NET Core Application with NLog
21 Feb 2022 by Illya Reznykov
Creating Regional Web ACL with CloudFormation
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...
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
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.
25 Jul 2012 by Bathooman
please help me!! i want to log some data of my program using syslog().but i don't know the procedure,i googled and i understood i should modify rsyslog.conf but i dont have permission to modify it!!please help!!
26 Aug 2012 by RuanSmit
My lecturer said we should think about a report log that you use on a windows form.basically what i am asking is if a user uses my winform that is connected to a database and they add, modify or delete from a database i could just have a button to show the "activity" if any in a text box or a...
26 Aug 2012 by Maciej Los
In my opinion, you need to create an 'user-activity' database. It's simple to do, because it should at least have only one table, like this:ActivityID - INT (IDENTITY)UserID - INT -> user name, id or any other unique valueDatabaseID -> database name, id or any other unique valueTableId...
30 Aug 2012 by RuanSmit
ok so i want to get all changes made by a user to be showed in a txt file.if a user makes changes to my database add/modify/delete and i want to know i want a button and if its clicked there should be a txt file with info in it.public log(){initialized component}private string...
30 Aug 2012 by Dr.Walt Fair, PE
Unless I'm missing something, you have 2 separate issues here. Correct me or explain better if I misunderstood.1) While a user is editing, you need to save a list of changes. Where do you plan to save that? In a text file? Should it be overwritten each time or appended? How large should the...
30 Aug 2012 by AmitGajjar
Hi,To get all the changes made in the database into a file you need to follow two steps(Although i am not recommend it.)First of all you need to create a trigger to write log in separate Table(LogTable). and then using BCP[^] command you can extract your Table log into CSV data file in...
19 Sep 2012 by Santhosh G_
Parser will get three information(On, Active, Temperature) at time X, then parser write it to file like this.printf( "%s status of machine is %s", X, On );printf( "%s Mode of machine is- %s", X, Active );printf( "%s Temp is- %s", X, Temperature);Please change like thisprintf(...
19 Sep 2012 by Santhosh G_
time_t rawtime;struct tm * timeinfo;time ( &rawtime );timeinfo = localtime ( &rawtime );char datebuff[1024];sprintf( datebuff, "%02d/%02d/%02d::%02d:%02d:%02d", timeinfo->tm_mon + 1, timeinfo->tm_mday, ( timeinfo->tm_year + 1900 ) % 100, timeinfo->tm_hour,timeinfo->tm_min,...
1 Oct 2012 by Stefan_Lang
If you use a limited length format string for a number (e. g. "%4d") , and the number is too big to fit, it will be represented as a sequence of '#' instead.Suggested fix: check your formats and make sure the numbers do fit in, or write the number in an unrestricted length format into an...
24 Oct 2012 by Rohit Shrivastava
HiI have configured enterprise library logging application block 5.0. I have successfully logged in flat file, however concern here is I am getting extended properies twice one section with repetive information.Following is my log:----------------------------------------Timestamp:...
24 Oct 2012 by Rohit Shrivastava
Sorry guys, figured out my silly mistake.I was using wrong overload of Logger.Write.changed EntLib.Logger.Write(logEntry, extendedProperties); to EntLib.Logger.Write(logEntry);It was treating logentry as message. :(
7 Jan 2013 by Plantronics
How to Enable Detailed Spokes Logging.
6 Nov 2012 by ♥…ЯҠ…♥
Hi friends, I want to record a log onto server2008 in eventviewer.Eventually its recording each and every events automatically, but what i want is to log a new event through my C# application.Is there any option that is possible to achieve this?Please help me ASAP.Thanks in...
6 Nov 2012 by bbirajdar
You need to use the EventLog class to log the error message to system eventviewerMore details http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog.aspx[^]
20 Dec 2012 by AlBurns
Hi.I am looking at the Enterprise Library 5.0 logging application block and am having a bit of trouble with adding a rolling flat file trace listener at runtime using the fluent configuration API. My intention is to add new trace listeners to the existing configuration at runtime and have...
20 Dec 2012 by AlBurns
Well, with a bit more diligence on my part I've solved the issue! All I had to do was to get a new LogWriter instance each time I added a new listener and make sure I used the appropriate object when logging so I moved the following code from just before calling the Write method to after the...
29 Jan 2013 by Daniel Carlström
Hi,I am currently working on rewriting my company's web service logging.The reason for doing this is that our production server is experiencing heavy load during peak hours. The current setup is very intensive on our database.Before I dig into things; I post this so that more...
25 Mar 2013 by Karthikeyan Mathiyalagan
Dear All, i am using IIS 7.5 and HttpLogging.so when am run the IIS hosted application and web service the entry to write an log file. but the web service entry to write more than time at same line.other application entry was write signle time.RegardsKarthikeyan M
27 Mar 2013 by LeVar H.
I am currently working on a project where I am collecting log information from an application using Log4net and writing the information to a file. I am using Nxlog to monitor this file, parse the information contained in the file, and send the information to all of the desired locations, i.e....
15 Apr 2013 by Angela Lucchesi
My job is to create and store reports created from log table. Application is in production for a few years now. After a while as log grows report generation becomes slower. Our solution was to delete some records from a log table after a while. I have the source code of application and I need to...
20 Apr 2013 by anju_g
Hi,I am using delegates and event handlers. public delegate void StringReadEventHandler(string text); // Event to notify of a string read from stdout stream public event StringReadEventHandler StdoutTextRead; // Event to notify of a string read from stderr...
20 Apr 2013 by Richard MacCutchan
Use a TextWriter[^].
23 Apr 2013 by Manikandan Sekar
Hi guys, I need the log info for each and every session created in the web application in asp.net. the log file must be rollback by size 5I am using the following code. For each time the log file created i need to specify the logger configuration in the log file, after that I need to create...
29 Apr 2013 by ravithejag
How to fetch he values from extended propertiestry { // ... } catch (Exception ex) { ex.Data.Add("Hello", "World"); throw ex; }The exception is logged correctly, but I can’t find the added data anywhere in the log file.
29 Apr 2013 by ravithejag
it worksforeach (DictionaryEntry item in ex.Data) { string exceptionData = item.Key +" "+ item.Value; }
29 Apr 2013 by Subha Elangovan
Hi, I am a beginner in pantheios. i want a totally customized logging for my c++ project. The scenario is: 1. my project has more than 1 process. 2. each process has multiple modules. 3. my log statement should look like : [process_id,module_name,time]severity : log_statement 4. i...
1 May 2013 by Subha Elangovan
Hi,I created my own custom back end to log into a file. I dont know how to print the severity level as a string. Pantheios stock backend does this. But I could not trace it back how it does. Please anyone help me to do thisThanks in advance
3 May 2013 by Subha Elangovan
Hi,I have defined my own custom back-end to log into a file using pantheios.My log function call is like this log(debug,"statement to be logged",module name,file name);I want to do some processing with module name and file name at back-end and then log them into the file. so...
22 May 2013 by Vipin kumar.P
Try to open the file with OpenWith option Select your file and click mouse right button and go for the option OpenWith and select the appropriate program
3 Jul 2013 by aihua1
Now our project has done half of year, we need to add logging framework on our code.For example:Enter/Exit funtion and occur exception is common requirement.I'd like to use AOP to finish. But,spring.net AOP is face to interface, proxy only to use on interface,a class need inherit an interface...
4 Jul 2013 by Harshdeep Mehta (4700787)
Try Semantic Logging from Microsoft. It's little complex to implement, but it has advantages.http://channel9.msdn.com/posts/Introducing-Semantic-Logging[^]
5 Jul 2013 by Gabriel Sas
hello,I am starting to create a new game in asp.net MVC 4(web based), but i don't have any knowledge if i should use a logging system and an Entity Framework or LINQ to SQL for the connection to database since i haven't worked with them before.Should i use them? the game will get very...
16 Jul 2013 by ♥…ЯҠ…♥
Hi Friends,I am using N-Tier architecture in my application.That consists of MVC web application, proxy project, WCF service project, business layer project, data layer project.I am logging the application activity through Log4Net framework.Now logging is working for MVC Web...
16 Jul 2013 by praks_1
Hi,see this link:http://sadi02.wordpress.com/2008/06/29/log4net-tutorial-in-c-net-how-can-i-show-log-in-a-file/[^]And u don't have to copy .xml file to all project u can do other way round also.
16 Jul 2013 by superschaf
SITUATION:Our logging Database grows very fast. We have approximatly 25GB of logging Data in 14 Days. But there are a few automatic User in our Sharpoint system and they create about 90% of the usage Data.NEED HELP ON:I wanted to know if it is possible to exclude these automatic users from...
17 Jul 2013 by superschaf
I haven't tried it yet. But mabey there is a way to filter the data before storing it into the database... http://todd-carter.com/post/2011/05/03/Extending-The-SharePoint-2010-Health-Usage-Part-2-Writing-a-Custom-Usage-Provider[^]
18 Jul 2013 by ♥…ЯҠ…♥
Hi Friends, I solved this by creating separate project called log4netwrapper to log the application.I designed a class to read the log4net config file then, i wrote a class for different debug levels.Now I referenced the log4netwrapper dll to all the layer and I added configuration to...
31 Jul 2013 by GauravThorat
Hi All,I wanted to Log the things (any error or successful operation in asp.net), so which is the best approach for doing this. I know one method which is file handling.Thanks
31 Jul 2013 by Bernhard Hiller
Get a logging framework, e.g. Log4Net (http://logging.apache.org/log4net/[^]).Add logging statements to all those functions manually, or add them using Aspect Oriented Programming methods (some Dependency Injection / Inversion of Control containers like Unity (http://unity.codeplex.com/[^])...
31 Jul 2013 by Abhinav S
Try Create Simple Error Log Files using ASP.NET and C#[^]
25 Sep 2013 by zeego
I want to maintain an eventlog for each user in my asp.net application. This application usescustom code using sessions for all authentication purpose. I want to log events like login, logoff, invalid password attempts, account expired etc. Should I use a logging framework or a database table?...
29 Sep 2013 by Singh Gyan
C# provide you Environment library to get all details of the system. Similarly you cab use browser object to retrieve browser history.
11 Oct 2013 by ASP.NET Community
This article presents a way to log and mail the errors from any web page.It logs following details -Control on which the error is raisedPage
11 Oct 2013 by ASP.NET Community
Global.asax, is the global file in the web application, which offers application level events to be registered. There are many of the events in this
16 Oct 2013 by pmcm
Hi I am trying to get the number of files copied value from a logfile produce by a RoboCopy method within my application. The logfile is always in this format: ------------------------------------------------------------------------------- ROBOCOPY :: Robust File Copy for...
17 Oct 2013 by Mart Rijkers
Output your array of strings like this:foreach (string s in splitContent) Console.WriteLine(s)
17 Oct 2013 by Mart Rijkers
If \t doesn't work, could it be there are spaces? Try this:splitcontent = System.Text.RegularExpressions.Regex.Replace(content, @"\s+"," ").Split(' ');It replaces all spaces with a single one and then splits the string
17 Oct 2013 by pmcm
here's my full working example:static void Main() { try { // Open file for reading. using (StreamReader r = new StreamReader(@"C:\LogFile.log")) { // 2. ...
3 Dec 2013 by fierascu.mihaela
Hi,I have a website which direct the users to a Joomla 2.5 page, but I would like to keep my content (article) private and to be accessed just by authorized users (by ip) without their log in.I have already searched a plugin, but I just found solutions with log in.Can you suggest me...
18 Dec 2013 by Member 9952554
Hi,I can maintain log in Event Viewer in my Local Machine but I have to maintain log on Server.I am using Enterprise library for logging. What configuration i have to do to maintain log in Event Viewer on Server?Thanks.Regards,Sahil Maheshwary
14 Jan 2014 by Member 10424204
using firebreath..I used to create log for only filename using this codeFBLOG_ERROR("SampleAPI","");Now i need to create log details also for(date,time,Function Name,OS Name,Browser Name and Description about the Error)How to log these details using firebreathIt Would be a Great...If...
30 Jan 2014 by Member 10329144
I am having a scenario in my WCF application where I need to log the requests into the database upon exception I have stored my request in a dictionary and used IsFault to check whether my request is fault, if it is fault than I have logged it into the database public static string...
12 Feb 2014 by Gyuwon Yi
My team is designing the RESTful API platform with ASP.NET Web API.So we want to log workflow for each http request for instance client identity, controllers, actions, biz modules, dal modules and so on.Now I consider using message handler, web api filters and real proxies but if there is...
12 Feb 2014 by Dave Kreskowiak
Why not let the webserver do the logging? Every good webserver I've ever seen supports HTTP request logging.
14 Feb 2014 by Paramaa
Hi friends , My client has using Microsoft.Practices.EnterpriseLibrary.Logging dll for write Log. I don't know why? Can u anyone explain about the feature of Microsoft.Practices.EnterpriseLibrary.Logging Compare to normal logging using EventLog. It's my client code for using enter...
24 Feb 2014 by Member 10621073
I have created a sample program and every time I run this program, it is creating a dummy entry in the event log as below. How to avoid without creating a logger?2014-02-24 18:04:53,557 [8] ERROR Log4NetSample.Program [(null)] - Error messageMy Code:using log4net;using...