Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4273168
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:40:34+00:00 2026-05-21T07:40:34+00:00

I am considering the architecture for an enterprise logging service. Its job would be

  • 0

I am considering the architecture for an enterprise logging service. Its job would be to receive and store log messages and then allow access to those log messages to users. Instead of building the logging functionality into our one existing Windows service that would use it for now, we need to separate it so that other services could use it in the near future. I like the fact that our various services could log their messages over net.tcp and then I could build a RESTful interface for delivering specific log messages to browsers or whatever.

Could anyone speak to the wisdom or lack of the following choices:

  1. Use WCF for the logging service
  2. Use net.tcp for the transport
  3. Host the service in a Windows Service project (using ServiceHost)

Also, how might I design it such that it takes advantage of some rather beefy servers that are going to be hosting it? Is it possible to open up multiple connections (or is that done automatically) or implement some automatic multi-threading?

The one service we currently have that would be utilizing this logging service is quite verbose and would be sending log messages very frequently (~40-100k/day). I have not yet built up a prototype and done any benchmarking and I know I’m not giving you enough details to make a definitive decision, but I’m just looking for some direction and considerations at this point. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T07:40:35+00:00Added an answer on May 21, 2026 at 7:40 am

    There are other alternatives to creating one more service just for logging. You could build the logging as an aspect and attach/detach this aspect (aka inject) as and when required by any ServiceContract or OperationContract. This way you decouple logging but it avoids the overhead of calling one more service on every call. Once you create these aspects, compile them away in separate binary and use them as and when needed in all of your future services, enabling and disabling specific logging scenarios are more maintainable IMO compared to having a dedicated service for just logging.

    Have a look at following two posts and they provide simplistic approach of doing this, you’d have to fill in the flesh as you want for your project.

    • Creating a logging Aspect
    • WCF Extensibility: Parameter Inspectors

    Important MSDN documentation you’d want to look at.

    • IParameterInspector
    • IOperationBehavior
    • IServiceBehavior

    Edit – Sample Code

    With below code you add [OperationLogging] above any of your operation contract, and you can intercept calls to this operation contract in LoggingInspector.BeforeCall.

    Use [ServiceLogging] on any service contract and all the operations defined in that service calls could be intercepted and logged.

    Set your_app_config_key to anything other than TRUE these additional behaviors are not added to your service pipeline. That is very cool as none of this code is executed based on this key in config.

    public class LoggingInspector : IParameterInspector
    {
        private string service;
        public LoggingInspector(string serviceName){ service = serviceName;}
        public void AfterCall(string operationName, object[] outputs, object returnValue, object correlationState){}
        public object BeforeCall(string operationName, object[] inputs)
        {
          // your logging logic
        }
    }
    
     //Operation Logging attribute - applied to operationcontracts.
     [AttributeUsage(AttributeTargets.Method)]
     public class OperationLoggingAttribute : Attribute, IOperationBehavior
     {
        public void AddBindingParameters(OperationDescription operationDescription, BindingParameterCollection bindingParameters){}
        public void ApplyClientBehavior(OperationDescription operationDescription, ClientOperation clientOperation){}
        public void ApplyDispatchBehavior(OperationDescription operationDescription, DispatchOperation dispatchOperation)
        {
            if (ConfigurationManager.AppSettings["your_app_config_key"] == "TRUE")
                dispatchOperation.ParameterInspectors.Add(new LoggingInspector(dispatchOperation.Parent.Type.Name));
        }
        public void Validate(OperationDescription operationDescription){}
     }
    
     //Service Loggign attribute - applied to Service contract
    [AttributeUsage(AttributeTargets.Class)]
    public class ServiceLoggingAttribute : Attribute, IServiceBehavior
    {
        public void AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, Collection<ServiceEndpoint> endpoints, BindingParameterCollection bindingParameters){}
        public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
        {
            if (ConfigurationManager.AppSettings["your_app_config_key"] == "TRUE")
                foreach (ServiceEndpoint endpoint in serviceDescription.Endpoints)
                    foreach (OperationDescription operation in endpoint.Contract.Operations)
                        operation.Behaviors.Add(new OperationLoggingAttribute());
    
        }
        public void Validate(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase){}
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't imagine an architecture would design an access to its smallest data type
Considering you have an MVVM Architecture in WPF like Josh Smith's examples How would
Considering that simple java code which would not work: public class Bar extends AbstractBar{
When considering social web app architecture, is it a better approach to document user
I'm considering a multi-threaded architecture for a processing pipeline. My main processing module has
Long version: I'm new to erlang, and considering using it for a scalable architecture.
Not considering legal issues I would be very interested if it would be possible
We're considering moving to a new architecture with one master Redis database and 10
SQL Server 2008 database design problem. I'm defining the architecture for a service where
I'm considering Redis for a section of the architecture of a new project. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.