<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener("load", function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <iframe src="http://www.blogger.com/navbar.g?targetBlogID=12803833&amp;blogName=thomasnguyen.com&amp;publishMode=PUBLISH_MODE_FTP&amp;navbarType=TAN&amp;layoutType=CLASSIC&amp;homepageUrl=http%3A%2F%2Fwww.thomasnguyen.com%2Fblog%2F&amp;searchRoot=http%3A%2F%2Fblogsearch.google.com%2F" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" height="30px" width="100%" id="navbar-iframe" title="Blogger Navigation and Search"></iframe> <div></div>
home blog contact

Subtopic: QUICKLY Get log4net Setup.
Tuesday, January 22, 2008
(This is a subtopic of the Learning NHibernate by Example (Small).)

It took me a while to get used to log4net version 1.2.10. Here's my attempt at a quick crash course on what I consider the basics of log4net.

Step 1: Download and reference it, derrr.

Step 2: Create a log4net.config file. I put mine in the OrderSystem.UI section, in the same location as the app.config of the startup application.

Here is mine, for now:
<?xml version="1.0" encoding="utf-8" ?>
<log4net debug="false">

<!-- Console Appender declaration -->
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%-5p : %m%n" />
</layout>
</appender>

<!-- Default configuration-->
<root>
<level value="INFO" />
<appender-ref ref="ConsoleAppender" />
</root>

<!-- Overriden configuration by class name -->
<category name="NHibernate">
<level value="Error" />
</category>
<category name="OrderSystem.UI">
<level value="ALL" />
</category>
<category name="OrderSystem.DataAccessLayer">
<level value="ALL" />
</category>
<category name="OrderSystem.Objects">
<level value="ALL" />
</category>

</log4net>


Step 3: Pickup the log4net.config file. I added this to the bottom of my OrderSystem.UI's AssemblyInfo.cs file.
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]

Step 4: In any class - Import the namespace.
using log4net;

Step 5: In any class - Get the logger instance.
private static readonly ILog log = LogManager.GetLogger(typeof (Program));

Step 6: In any class - Use it.
log.Info(summary);

VOILA, now you can configure logging with an external configuration file.

Labels: , ,

3 comments
Learning NHibernate by Example (Small).
Friday, January 18, 2008
So I started a new project a couple weeks back and I'm going to put off separating the common features into a "CommonProject" until later. I've run into a few tedious steps over and over again, that I already knew NHibernate would help me resolve quickly and easily. Once this is complete, I'll take a look to see what needs to be done.

I like what I see already in NHibernate; I'm just not too happy about support for NHibernate.org and their community, or lack thereof. I downloaded a sample, but it's not using the most up-to-date version, which is currently 1.2.1GA. I have a working version of it. If you want it, let me know.

(By the way, does anyone know what the "GA" in 1.2.1GA means?)

My environment:
Microsoft SQL 2005
Microsoft Visual Studio 2005 (ReSharper 3.0.2)
NHibernate 1.2.1GA

Labels: , , , ,

3 comments
Dreamhost Rocks.
Wednesday, January 16, 2008
Although I was one of the few who got affected by this little accounting problem, I still really respect Dreamhost. Not only did the blog an apology and email me an apology, they even explained why this occurred and their solution to it. Honesty is the best policy.

I even learned something from them:
"The moral of this story is that “flexibility” is rarely desired in programming! The less a program will accept/the less a program will do/the less options and preferences it has, the more usable it is/the more understandable it is/the more stable it is."

It's too detailed to be made up, I guess. Anyway, my account is fixed and I'm still keeping my hosting with them.

Labels: ,

0 comments
GAIM + Synergy = BOOM.
Saturday, January 05, 2008
Anyone else run into this issue? I have both up and running just fine for about an hour. Just a while ago, I moved my mouse to the other (client) machine, tried to go back to the (server) desktop, and everything freezes on the desktop.

I tried to remote desktop in, but the whole screen is frozen, BOO.

Labels: , ,

0 comments
Multiple Projects, Similar Functionality.
Thursday, January 03, 2008
I started a project more than a month back using Subversion, NUnit, and Trac. Here's the problem now: I have a new project that does almost the same thing. They're totally different projects and have no dependencies on each other. There's just a set of code that could be reused by the new project.

How should I handle the source code?
1. I could just keep them separate and that's no problem at all.
2. I could branch off and start a parallel project within the current repository.
3. Something else?

I haven't had experience with this situation and need some suggestions.

Labels: ,

1 comments





Recent Posts
Reading Material: Writing Secure Code.
No Right Click? Use Shift + F10.
Hurricane Ike Recovery.
CI in SD Conference.
Microsoft ArcReady Event.
University of Houston Alumni Organization.
Arrested Development - Great Show!
NYTimes.com - Double Click a Word, Try It.
Secure Vantage Technologies is Hiring.
SqlException: Invalid object name.

Archives
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
May 2008
June 2008
July 2008
August 2008
September 2008
October 2008

Blogger
copyright 2006-2008 | thomasnguyen.com

Google Reader flickr del.icio.us nike+