Here is a nifty little example of how to pipe console output to Microsoft LogParser, in this case the results of a ping against Google.
ping -n 15 www.google.co.uk | "%pathTologparser%\LogParser"
"SELECT TO_INT(REPLACE_STR(EXTRACT_VALUE (Text,'time',' '),'ms',''))
AS Response INTO Ping.gif FROM stdin WHERE Text LIKE '%%Reply%%'
GROUP BY Response" -i textline -legend off -chartTitle "Ping Times" -view
Note: I have inserted line breaks for readability, this should be written as one line.
Replace %pathTologparser% with the path to your local LogParser installation, typically c:\Program Files\Log Parser 2.2 or c:\Program Files (x86)\Log Parser 2.2 on x64 installations.
When using nHibernate in a windows service you may find that you encounter FileNotFoundExceptions when trying to load assemblies or external configuration files. Typically this is in scenarios where you are running your service under a user context such as NetworkService.
If you hunt around long enough you will find that it is trying to locate said files in the %WINDIR%\system32 folder (for example c:\windows\system32), and not from the services own directory.
By default window services set the default directory to the %WINDIR%\system32.
Simply change your service's default directory to wherever your service is running.
Here's a sample:
// Set current directory to assembly folder
// Need to to this so can find the configuration file for the logger
// default is %WINDIR%\system32 for window services
static void Main(string[] args) {
Environment.CurrentDirectory = System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetEntryAssembly().Location);
///...
}