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 1026937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:09:38+00:00 2026-05-16T12:09:38+00:00

In the castle stack? after the answer I came up with this: namespace Limpens.Windsor.LoggingAspect

  • 0

In the castle stack?

after the answer I came up with this:

namespace Limpens.Windsor.LoggingAspect
{
    using System;
    using Castle.Core;
    using Castle.Core.Interceptor;
    using Castle.Core.Logging;
    using Castle.MicroKernel;
    using Castle.MicroKernel.ModelBuilder;

    public class LoggingContributor : IContributeComponentModelConstruction
    {
        public void ProcessModel(IKernel kernel, ComponentModel model)
        {
            model.Interceptors.Add(new InterceptorReference(typeof(LoggingInterceptor)));
        }
    }

    public class LoggingInterceptor : IInterceptor
{
    private const string Format = "HH:mm:ss:fff";
    private readonly ILogger _logger = NullLogger.Instance;

    public LoggingInterceptor(ILogger logger)
    {
        _logger = logger;
    }

    public int TresholdInMs { get; set; }

    #region IInterceptor Members

    public void Intercept(IInvocation invocation)
    {
        var start = DateTime.Now;
        invocation.Proceed();
        var finished = DateTime.Now;
        var duration = (finished - start).Milliseconds;

        if (duration < TresholdInMs) return;

        var typeName = invocation.TargetType.Name;
        var methodName = invocation.Method.Name;

        _logger.DebugFormat("{0}.{1} started at {2} and finished at {3}. Took {4} ms.",
                            typeName,
                            methodName,
                            start.ToString(Format),
                            finished.ToString(Format),
                            duration);
    }
}
  • 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-16T12:09:39+00:00Added an answer on May 16, 2026 at 12:09 pm

    out of the box? No I don’t think so. It’s trivial to do with custom ComponentModel construction contributor though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Castle Windsor's inversion of control in my application. When the application
Castle Windsor just came out with a Fluent interface for registering components as an
Using Castle.Windsor in ASP.NET MVC (3.0) is there any way I can appropriately handle
A few questions about Castle Windsor. I have a service that looks like this:
I'm using Castle project ActiveRecord and SqlServer 2008 I wanna do this : ActiveRecordMediator<Question>.FindAll();
I decided to make a system for a client using Castle ActiveRecord , everything
I am using castle windsor and the session per web request pattern to manage
Using Castle ActiveRecord / NHibernate: Is there a way you can force an ICriterion
A Castle Windsor question: Is it possible to register a class that has an
Is registering components on castle windsor thread-safe? I.e., can multiple threads simultaneously register components

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.