IT Hit WebDAV Server Logging

IT Hit WebDAV Server has a built-in logging functionality provided by FileLogger class. If you experience any problems with WebDAV the first thing you should do is to examine your WebDAV server log file.

By default, the log file is created in the folder where the calling assembly resides (your .exe or .dll file). You can specify the folder and file name setting FileLogger.LogFile property. The folder in which you plan store your log files must exist and your application must have enough permission for writing and creating files in this folder. Note that if you are creating HttpHandler-based WebDAV server usually on Windows XP your web application will run under ASPNET account while on Windows 2003 it runs under Network Service account.

If you are requesting your server with a WebDAV client and log file is not created, most likely there is no permissions for creating file or the web requests simply does not reach your application.

FileLogger.Level property provides the method of limiting amount of logging output. During the development, you will usually set Level to All or Debug level while deploying you can set it to Error or Fatal.

FileLogger.LogFile = "C:\\WebDAV\\WebDAVServerLog.txt";// C:\WebDAV\ must exist and the application must have enough permission to write and create files in this folder

FileLogger.Level = LogLevel.Warn;

FileLogger.WriteMessage("My error message", LogLevel.Error); // this message will be written to the log file

FileLogger.WriteMessage("My debug message", LogLevel.Debug); // this message will not be written to the log file

FileLogger.WriteMessage("My info message"); // this message will not be written to the log file

Logging in IIS/ASP.NET Application

If you host your server in IIS/ASP.NET make sure your log file is created outside of the \bin folder. If your logfile will be created in a \bin folder, your server will restart each time the logfile is updated, recycling application and session state.


See Also: