Вот очень простой пример:
import logging
l = logging.getLogger("test")
# Add a file logger
f = logging.FileHandler("test.log")
l.addHandler(f)
# Add a stream logger
s = logging.StreamHandler()
l.addHandler(s)
# Send a test message to both -- critical will always log
l.critical("test msg")
Вывод будет отображать «test msg» на stdout, а также в файле.
См. Мой ответ здесь: ASP.NET MVC и httpRuntime executionTimeout
I believe the Path attribute shouldn't start or end with a "/" - so you should have:
<location path="File">
<system.web>
<httpRuntime executionTimeout="60" maxRequestLength="4096" />
</system.web>
</location>
<location path="Picture">
<system.web>
<httpRuntime executionTimeout="60" maxRequestLength="1024" />
</system.web>
</location>
Your virtual or physical directory–level Web.config's shouldn't have the
That should sort you out.
The docs for the Location element even have this very example:
The following code example demonstrates how to set the uploaded file size limit to 128 KB for only the page specified.
<configuration>
<location path="UploadPage.aspx">
<system.web>
<httpRuntime maxRequestLength="128"/>
</system.web>
</location>
</configuration>