Click here to Skip to main content
15,896,201 members
Articles / Programming Languages / C#

AppLogger, a Simple Distributed Application Logger - Part 2 (Using MSMQ)

Rate me:
Please Sign up or sign in to vote.
4.71/5 (7 votes)
15 Jul 20044 min read 67.3K   1.3K   27  
Concluding article for simple distributed application logging
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<appSettings>
		<!--
			AppLogger.Type allows changing the type of logger during 
			runtime. Eg. ConsoleLogger, FileLogger, EventLogger, DbLogger, DebugLogger
		 -->
		<add key="AppLogger.Type" value="AppLogger.BusinessRules.ConsoleLogger" />
		<!--
			AppLogger.DbConnection applies to DbLogger only. 
			<add key="AppLogger.DbConnection" value="Server=<hostname>;Initial Catalog=<dbname>;user id=<id>;pwd=<password>;" />
			AppLogger.DbConnection applies to DbLogger using Trusted connection only. 
			<add key="AppLogger.DbConnection" value="Server=<hostname>;Initial Catalog=<dbname>;Integrated Security=SSPI;" />
		 -->
		 
		<!--
			AppLogger.MSMQ is for MsmqLogger only. Private queue "applogger" must exists in local machine. 
			Client side must have the following in <appSettings> 
			<add key="AppLogger.Home.Location" value="msmq:FormatName:DIRECT=OS:.\private$\applogger" />
			Server side, which is this App.config, must have the following in <appSettings> 
			<add key="AppLogger.MSMQ" value="FormatName:DIRECT=OS:<hostname>\private$\applogger" />
		 -->
		<add key="AppLogger.MSMQ" value="FormatName:DIRECT=OS:bordeaux\private$\applogger" />
	</appSettings>
	<system.runtime.remoting>
		<application name="AppLogger Service">
			<!--
				The Remoting TCP port.
			-->
			<channels>
				<channel ref="tcp" port="20911" />
			</channels>
			<service>
				<!--
					The Remoting config for the concrete IHome.
				    <wellknown mode="Singleton" type="AppLogger.BusinessRules.DefaultAppLogger, AppLogger.BusinessRules" />
				-->
				<wellknown
					mode="SingleCall"
					type="AppLogger.BusinessRules.DefaultHome, AppLogger.BusinessRules"
					objectUri="AppLogger.IHome.rem" />
			</service>
		</application>
		<!--
			The Remoting config customErrors must be set to "off" for
			serialization of exceptions across tiers.
		-->
		<customErrors mode="off" />
	</system.runtime.remoting>
</configuration>


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Singapore Singapore
A software craftman, the roads I travelled include C++ to Java to C#, from Windows to Unix and now Microsoft .NET.
Full-time, I play the pragmatic roles of software designer, engineer and architect in the programming trenches.

Comments and Discussions