praetorean.nomad

hi all,

i am currently poking around to work on a logging framework for my project, & i'm leaning towards a SOA based implementation but i am not certain if this is a way to do it.

basically this is the process that i'd prefer to happen...
1- i have a service consumer application... this application will have a feature to keep track of all activities i.e. audit logs, exceptions, etc.

2- the consumer application then sends the logs to the service, wherein it's the service that actually does the work on processing the logs & storing them to their respective sinks.

is this a sound approach ... my intent is actually to keep the logic of the logging on the services only...
also the logging will be leveraging from the Enterprise Library...

Thanks...



Re: Architecture General SOA-based logging...

Ollie Riches

So what happens if the logging service is unavailable for some reason does your application stop working

Ollie Riches






Re: Architecture General SOA-based logging...

Ahmed Nagy

Hi;

I'm not sure of SOA based approach is a good solution for this. SOA is meant to serve inter-business communication and not how building a single application.

Based on the Plugin pattern, we used to tackle such a problem using the IServiceProvider to implement common services that lives in the application execution context. All application components can access the same service using a Singelton that acts as the service(s) container. All services are initiated at the application/process startup.

The servicess might include Logging service, Exception Management Service, Data Persistence Service...etc. Many MS based products are based on this.

This approach fits in your situation more than a SOA based approach does. It provides optimum performance and same pluggability as a SOA based approach does. It also avoids unnecessary communication failures that might impact and complicate your application. It will even provide more customization capabilities to your service from one application to another.






Re: Architecture General SOA-based logging...

frederikm

Hi

as stated above, the problem lies in availability, speed and so on

if you really want a central logging service, one thing you could do is provide multiple implementations

in pseudo code:

Code Snippet

public class Log{

private static List<ILogger> _loggers;

public static void Log(...){

foreach(ILogger logger in _loggers){

logger.Log(...)

}

}

}

that way you can have both a local and a central logging service...

take a look at the entreprise library logging block, which does a similar thing

Hope this helps you out






Re: Architecture General SOA-based logging...

J. Ambrose Little

Enterprise Library has a built-in facility for this scenario. Look in the docs for the Distributor Service. I wouldn't get caught up in whether or not this is SOA. As long as it meets your needs, it doesn't matter.




Re: Architecture General SOA-based logging...

praetorean.nomad

thanks for the feedback.

"Based on the Plugin pattern, we used to tackle such a problem using the IServiceProvider to implement common services that lives in the application execution context. All application components can access the same service using a Singelton that acts as the service(s) container. All services are initiated at the application/process startup. "

i am finding it interesting, could you please provide me with more details on your advise ...

i am not certain if i'm following this, coz my understanding of service is a webservice but then again, i might not be following this...

thanks, as




Re: Architecture General SOA-based logging...

Ahmed Nagy

Hi;

A service is not a web service. A service is a software component that has some defined and exposed interface and encapsulate some business logic. We used to develop service components using COM+ and other technologies. Today, WCF allows you to do this naturally, you can expose your service as web service, native named pipes...etc. As a start, you might look for "Service Layer pattern" if you are interested in services.

Back to your issue, what we used to do is we start building services in form of components. Instead of using such services remotely we load the components in the same process that needs it. Say we want to make our software base on the model I described and you need to work with Logging service, Object Presistence Service and Exception Handling service (Just examples). Here's the steps...

* Define interfaces that you you will work with for each of the services.

* Create some Service Manager that knows your service instances or know how to create them.

* when your program starts, before it initiates, load the services you want or their definitions and pass them to the service manager...

LoggingService ls = new LoggingService()

MyServiceManager.Add(ls, typeof(IMyLoggingService))

MyServiceManager.Add(Typeof(MyObjectPresistenceManager), typeof(IMyObjectPresistenceManager))

Here, your service manager have all information to give you the required service. Now, in all your code and referenced components you can access the services like this...

IMyLoggingService ls = MyServiceManager.GetService(typeof(IMyLoggingService)) as IMyLoggingService;

ls.Logg(xyz);

Now...I hope that explains it all.

The above can be combined with some good stuff like "Separated Interfaces Pattern" which allow you for more de-coupling of services. You can aid it with some reflection technique to load the services from config files. Even more, you can combine it with Factory patter for more poewrful implementation.

I'm not sure if this is true match for the Plugin pattern (I hope someone can say what it matches). This technique is used in Windows Workflow Foundation and Microsoft IDEs.






Re: Architecture General SOA-based logging...

praetorean.nomad

my apologies for taking too long to reply...
i like the insight provided... however, i just decided to use the Logging Application Block on both my web service & application. at least this makes it somehow easier on my part..

niways, thanks a lot...