0

The following line in 51Degrees.mobi.config adds 2-3 seconds of loading time to each of my ASP.NET MVC 4 project's controller actions:

<fiftyOne>
    <log logFile="~/bin/App_Data/51Log.txt" logLevel="Info" />
    ...
</fiftyOne

The same thing happens for ASP.NET MVC 3. If I remove the <log> section, pages load almost instantly. I'm using the binary device database for detection like so:

<detection binaryFilePath="~/App_Data/51Degrees.mobi-Lite-2012.01.05.dat" />

Setting the logLevel to Debug causes the following exception:

`Storage scopes cannot be created when _AppStart is executing.`

Why does this cause such a drastic slowdown? Is it a symptom of a deeper problem?

Could there be an incompatibility with StructureMap for dependency injection?


Update: Thanks to @James Rosewell, I figured out why the logging slowed down my application. It's related to the logFile path. Everytime 51Degrees writes to the 51Log.txt file in the ~/bin directory, it causes IIS to recycle the pool and reload all the modules. Changing the log path to ~/App_Data solved the problem.

Petrus Theron
  • 25,051
  • 30
  • 137
  • 263

1 Answers1

0

I have responded to this thread on the 51Degrees.mobi forum. Please go to this link.

http://51degrees.mobi/Support/Forum/tabid/65/forumid/2/threadid/1519/scope/posts/Default.aspx

Thanks,

James

James Rosewell
  • 516
  • 3
  • 6
  • Thanks, solved it. Added update. If you post the solution on my other question http://stackoverflow.com/q/7860241/198927, I'd be happy to award you the bounty :). – Petrus Theron Jan 23 '12 at 11:34
  • copy and paste of OP's question to your forums and only responding there is lame. – Pat James Mar 14 '12 at 16:15