SIDEBAR
»
S
I
D
E
B
A
R
«
Log viewing programs
Feb 22nd, 2008 by sleepikatkat

I’ve been using log4j for years. Viewing those long files have been a pain no matter what projects I worked on.  It’s not the format itself, but just long long lines and even longer files…

Windows by default opens .log in NotePad, which isn’t designed to handle large text files.  Try opening a 5mb text file.  NotePad is going to hang.  What a pain.

I’ve been using NotePad++ and TextPad for quite a while and have grown to depend on them quite a bit.  NotePad++ is light weight and fast.  I highly recommend using it as replacement of Windows NotePad.  It has syntax highlight and can handle large files.  TextPad has syntax highlight as well.  But biggest advantage of it is the ability to do automatic reload when the file is changed from external sources.  That works very well with log files.  I have yet to find another text editor that can do auto reload as well.  Both software can do file edits (trim line, convert tabs to spaces and vice versa), find ASCII values of characters, number conversions in hex, oct, etc.

Having NotePad++ and TextPad definitely beats opening logs in WordPad or NotePad.  Sometimes I prefer to read the logs from within IDEs.  This, surprisingly, has a lot more options.  There are a number of plug-ins for Eclipse and IntelliJ to read (and tail) log files.  These log viewers work the best when you are running/debugging the application from within the IDE.

But still, imagine having to scroll 10000 lines just to find the part that you are looking for.  No matter how good TextPad and NotePad++ are, the log is still in black text white background (actually you can change the colors and fonts, too).  Every line looks just about the same as the rest!  I get dizzy having to stare at them.

Just yesterday, I found my new best friend with log files: LogMX.  It’s not free, but it’s a much better tool to view log4j logs.  Just specify the pattern that’s in the log4j/log4net config file, and open the log file.  You can let it reload the log, or suspend it any time.  Different levels of severity are in different colors, so any warning or errors REALLY stand out.  Not to mention the ability to filter the log for just certain packages and certain severity level.  Man I fell in love with it so fast and so hard that I was was telling my teammates about it the very next day!

Maybe there’s something even better out there for viewing logs, especially for log4j and log4net logs because they are so common in the development world.  Anybody knows any?  I would love to try them out.

Share
Starting on C#
Feb 8th, 2008 by sleepikatkat

Last month I started to learn and use C# for work. Everybody on the team is new to .NET. But in a Scrum environment, we have much to deliver with very little time (or no time in this case) for training. So I picked up a book or two and dived right into it…

At first I was so excited about Visual Studio 2005′s design view for all our UI need. Comparing to Java, I used to hand code every bit of UI code in a third-party SDK that’s a subset of AWT. We had to write tons of inner classes for event handling. C#’s delegate makes things sooo easy.. It’s like a dream. =)

Then when I started to work on the code, I found Visual Studio 2005′s refactoring support to be terrible comparing to Eclipse or IntelliJ. It’s a pain to move code around, or trying to change signature of a method. I won’t know what’s wrong until I compile. How I miss Eclipse & IntelliJ’s real-time error detection…

Then I found ReSharper. That’s like a heaven-sent gift! I spread the good news about it to my teammates and one of them commented “I don’t know how I have coded without it!” =) Great job in run-time error detection and tons of refactoring. I loved it, can’t live without it now.

On a different matter, I agree with one of my coworkers that just because you did it once, you become the dedicate person to do it in the future. She became our graphics person, though her title is User Experience Lead. I somehow become our team’s UI person just because I showed some interest in doing Ajax a while back, and devoted one week on trying to fix some UI bugs on the all-dreaded-Javascript code.

But I am starting to love this role. Everybody on our team likes to do hardcore Java, all the server side, database, web services, multi-threaded, multi-platform/multi-server support stuff. Nobody cared about doing UI before I came on board I guess. And now I get to work on stuff that pleases one’s eyes, easy to use, functional, intuitive, and, did I mention sort of pretty? Ha! It’s actually quite fun. But sometimes I do miss all my desire to do architecture and design work, as well as coding and debugging like a “real programmer”.

Can’t do both I guess.

Share
Random discovery of the day
Mar 14th, 2007 by sleepikatkat

Actually, it didn’t happen today. It was something that I found maybe a week ago, some oddity I thought, or maybe I was just being ignorant.

One of the tasks I have been doing for my project is to make a web site XHTML strict compliant. Well, the site was designed ages ago when it was probably still HTML 3.2 time. There used to have no DTD and the browsers rendered the site just fine. Now by just adding that one line of DTD declaring all pages to the XHMTL strict, we are doomed. None of the pages could be validated. *sigh.

Among everything we had attributes that are no longer supported in HTML 4.01, such as “target” attribute in <a href> tag, and attribute “name” in <form> tag. But almost all forms use “name” attribute! And inline+external JavaScripts depend on that!! Oh lord…

Luckily help is always somewhere online if one is willing to dig and dig and dig. I followed this tutorial by Kevin Yank to resolve all <a target> issues. Apparently that solution was out there for ages; I just didn’t know. =) That was nice and easy. <form name> issue was resolved by substituting “name” to “id”. I just had to remember all references to it in JavaScript.

One that that tripped me was the <tfoot> tag. The pages had a lot of data presented in tables. <tfoot> was introduced when we separated CSS from all pages. But browser validation always complains about it. It looked right to me. =\ I dig deeper into the World Wide Web begging for some clue. Eventually I found out that <tfoot> has to be declared before <tbody>. So the order should be <table><thead></thead><tfoot></tfoot><tbody></tbody></table>. What dah? It still doesn’t make sense to me. But oh well, as long as it validates…

Share
»  Substance:WordPress   »  Style:Ahren Ahimsa