find a location for property in a new city

Monday, 28 May 2012

How to turn off logging on Combres

I have been using Combres for my .NET app to minify, combine and compress my JavaScript and CSS. So far I have found it awesome.

It really does do everything it claims. Minifing your scripts and CSS, then combines them all so that all the code is sent via one HTTP request (well one for CSS and one for JavaScript). It also handles GZip or deflate compression should the request accept it. It is easy to set up since it is now available through NuGet and using it will make YSlow smile when it scans your site.

Logging

One thing that is annoying though is that Combres seems to log everything it does. "Use content from content's cache for Resource x...Use content from content's cache for Resource y" This is fine in development but unnecessary in production so I wanted to turn it off but couldn't find how to do this in any documentation.

The way I managed to turn off logging was to find the line in the web.config that combres put in that looks like this:

<combres definitionUrl="~/App_Data/combres.xml" logProvider="Combres.Loggers.Log4NetLogger" />

You simply need to remove the logProvider so it looks like this:

<combres definitionUrl="~/App_Data/combres.xml" />

If you still want logging on your development environment you can simply remove the logProvider attribute in a web.config transform.

Follow britishdev on Twitter

7 comments:

  1. Please keep on posting such quality articles as this is a rare thing to find these days. I am always searching online for articles that can help me. Looking forward to another great blog. Good luck to the author! all the best! http://celabright.org

    ReplyDelete
  2. Considerably the article is in reality the greatest on this noteworthy topic. I agree with your conclusions and will eagerly look forward to your next updates. Saying thanks will not just be sufficient for the wonderful clarity in your writing. I will immediately grab your rss feed to stay privy of any updates!
    SNA Auto Rental

    ReplyDelete
  3. Please keep on the posting this article because it is rear thing.

    ReplyDelete
  4. I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff your post

    ReplyDelete
  5. This article gives the valuable information . this is very nice one and gives indepth information. thanks for this nice article.
    Walking Holidays Europe

    ReplyDelete
  6. This is my first time at your blog and I've really enjoyed looking around. I will come back again in the future to check out some of the other articles.
    Fire Stopping

    ReplyDelete
  7. Thank you! Been wanting to turn off logging for months. (That's right, this is a real comment! Blast you spam-bots and your atrocious yet amusing grammar!) For the newbies, the Web.config file is found at the root level of the ASP.NET solution folder.

    ReplyDelete