Logging in the clouds

Topics: Logging Application Block
Feb 8, 2012 at 4:06 PM

Hi, We have a cloud web application. It consists of multiple servers that serve multiple users.
Due to the cloud's load balancing, each part of the application may be executed on another server.
E.g., if a user logs-in, performs several operations and logs-out, each operation may be executed on another physical machine.

I use EntLib5 for the logging of this application. Each application writes a rolling text file in its local machine.
Unfortunately, the log of a user's session is splitted across the cloud's servers (due to load balancing).

What is the best way to use EntLib logging in such an environment? Is there a way to write to a shared file? Can I synchronize the log among the servers
(e.g. if 2 servers write a log concurrently).
I considered writing the log to the shared DB, but the applications writes lots of trace and debug lines, and using a DB will increase the load.

Thanks
Sruli

 

 

 

Feb 9, 2012 at 6:19 AM

The Flat File Trace Listener, Rolling Flat File Trace Listener, and XML Trace Listener do function in Windows Azure but are not recommended.

The Trace Listeners that are useful are the Database Trace Listener (to write to SQL Azure storage), Email Trace Listener, Event Log Trace Listener, as well as the System Diagnostics Trace Listener (which lets you use the Azure Diagnostic Monitor Trace Listener).  

For example if you use the DiagnosticMontiorTraceListener the data is written to local storage and if configured (or on demand) the data is uploaded to Azure Table Storage where it can be viewed.

Most examples use the DiagnosticMonitorTraceListener as in Get logging in Windows Azure with Enterprise Library.  There is a wealth of non-Enterprise Library Azure logging information at Collecting Logging Data by Using Windows Azure Diagnostics.  

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com 

Feb 9, 2012 at 12:38 PM
Edited Feb 9, 2012 at 4:24 PM

Excellent. This is what I need, as far as Azure is concered.

However, I have to make sure that the application can also run on the Amazon cloud (EC2), using AWS (Amazon Web Services) SDK.

Can EntLib be used in Amazon at all?

Does anyone have experience with applications that work on both Azure & Amazon?

Thanks
Sruli

 

 

Feb 10, 2012 at 4:36 AM

You should be able to use Enterprise Library with Amazon EC2.  If you want an integrated cloud logging solution (e.g. consolidate logs between Azure and EC2) you might want to look at Splunk for consolidating logs.  I haven't used them and it might be overkill (seems like they have lots of features) but it might be something to consider.

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com 

Feb 12, 2012 at 10:06 AM

Randy,

The web app runs on either Azure or EC2, and I don't need to consolidate logs between them.

Is there an listener that works with EntLib in EC2 env, or I should develop it myself?
I didn't find any info or samples on using EntLib in EC2 env.
I would appreciate any hint.

Sruli

 

Feb 14, 2012 at 4:20 AM

I haven't used Amazon AWS but it looks like Enterprise Library should "just work".  However, if you want ensure that the logs are persisted then it looks like you can use the Database Trace Listener to write to SQL Server.  Otherwise you might need to write a SimpleDB trace listener.

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com