|
Sponsored Links
Resources
.NET Research Library
Get .NET related white papers, case studies and webcasts
|
News
News
News
|
Messages: 4
Messages: 4
Messages: 4
Printer friendly
Printer friendly
Printer friendly
Post reply
Post reply
Post reply
XML
XML
XML
|
 |
Rolling TextWriter TraceListener log files
One of the classic diagnostic tricks for long-running services is to have useful information written to log files for later perusal; unfortunately, those files often grow very large, so people "roll" them to different filenames as time progresses. Dave Bost describes how to do this for System.Diagnostic.TraceListeners.
Check out his weblog for his first-cut solution. One question he asks:There is one question I hope the blog community can help me come to a conclusion on. What happens when the log file rolls over and another process is trying to write a trace message during the rollover? Does that message get lost? Can I solve it through thread synchronization? Is this even an issue?
|
|
Message #120567
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Re-invent the wheel
<digression> Why is it that we continually re-invent the wheel? MS leveraged the experience of the existing development platforms/languages (C++, Java, Delphi, etc.) to create the .Net platform. This is the classic "technology leapfrog" strategy employed by companies (leverage and extend). So, why is it that we (the .net community) are not leveraging well-known technologies? The log4j logging/diagnostic framework is the dominant player in the Java community and the log4net port is a very usable .net analog. The log4j community solved these problems a while back with solutions that are (for the most part) platform AGNOSTIC.
Hence, if the dominant languages and development platforms are on a convergent path, then why do we diverge with the tools, frameworks, etc? Does this make sense? I am remiss to taint your thread with this tangent but this is a painful spot for me and the development teams that I represent. We do both .net and java development and prefer to use a neutral platform with as many semantically equivalent tools, frameworks, patterns, etc. as possible. </digression>
I suggest you look at the log4j rolling file appender for an idiom to manage this timing issue.
Thanks, Lance
|
|
Message #120572
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Re-invent the wheel
I agree with you in using Log4Net rather than reinventing the wheel. Even in Java World Sun introduced there own logging thingy instead of using log4j. NOT INVENTED HERE syndrome i guess.
|
|
Message #120573
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Point taken
Lance, I whole heartedly agree with you 100%. There's no need to re-invent the wheel. However, this excercise was more for my own benefit in understanding how much trouble someone can get into by implementing such as a simple feature. I can almost guarantee developers are creating these types of implementations without really understanding the consequences. I was just trying to get a dialog started to discuss the issues.
With that said, I will fire up my browser and pull down log4net.
Thanks for the advice.
Dave B.
|
|
Message #121173
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Does or will MS have its own
Log4J is good, but then Sun introduced their own anyway. So my question is does MS already have a solution that's like Log4net or will MS introduce one in .NET 2.0? Thanks for any feedback!
Ray.
|
|
 |
| |
|
New content on TheServerSide.NETNew content on TheServerSide.NETNew content on TheServerSide.NET |
 |
 |
Language "mashups" will become more prominent, and developers will become polyglots, one programmer suggests.
SearchWinDevelopment.com offers an introduction to the language, performance, testing and data management improvements in VS 2008.
VBCode.com code snippets cover all aspects of application development, from data binding to security to the user interface.
Get up to date on XAML best practices with a variety of articles, tutorials and webcasts. [SearchWinDevelopment.com]
One team's experience with the VSTS DB edition suggests that it can improve workflow for dev teams. It also enhanced Agile efforts.
(June 24, Article)
Microsoft has begun to include DSL tools in the VSTS kit. A new book by Steve Cook and other VSTS team members helps set the stage.
(June 24, Article)
Cartoon: Be it ever so humble there is no place like your home after you get a Microsoft Home Server .
(June 18, Cartoon)
Microsoft's Thom Robbins says new technology to highlight in NET 3.5 includes AJAX, LINQ for both C# and VB, as well as tooling enhancements intended to ease the task of building WPF, WF and WCF apps.
(June 29, Podcast)
Venkat Subramaniam discusses AJAX bottlenecks, the tenets of Agile development and more. He spoke at the Ajax Experience.
(June 25, Tech Talk)
In the second of a two-part series, Michele Leroux Bustamente discusses design decisions related to the claims-based security model. Read the story and walk through the process for creating a set of claims-based utilities to encapsulate claims authorization at the service tier.
(May 24, Article)
Understanding why the Entity Framework exists and learning where it can fit into your projects can get you prepared for the eventual release early next year.
(May 10, Article)
Resource: This learning guide gives you quick access to useful links on Windows Communication Foundation security information.
(April 24, Article)
TSS.NET's Jack Vaughan spoke recently spoke with Microsoft's Brad Abrams to find out what he is seeing in the field and what the chefs in Redmond are cooking. Along the way he discusses patterns of AJAX frameworks.
(April 11, Article)
In a two-part series, Michele Leroux Bustamente explains how claims-based security is supported by WCF, and how you can implement a claims-based security model for your services.
(March 29, Article)
Windows Workflow Foundation is a new technology that many developers will need to get their heads around. In a brief excerpt adapted from Programming Windows Workflow Foundation: Practical WF Techniques and Examples using XAML and C#, K.Scott Allen considers aspects of workflow definition.
(March 22, Chapter Excerpt)
|
|