惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
U
Unit 42
N
Netflix TechBlog - Medium
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
小众软件
小众软件
V
Visual Studio Blog
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
博客园 - 叶小钗
GbyAI
GbyAI
爱范儿
爱范儿
雷峰网
雷峰网
Microsoft Azure Blog
Microsoft Azure Blog
D
DataBreaches.Net
博客园_首页
D
Docker
A
About on SuperTechFans
G
Google Developers Blog
I
InfoQ
T
The Blog of Author Tim Ferriss
V
V2EX
博客园 - Franky

博客园 - Amonw's Weblog

.NET默认一个客户端对同一个服务器地址同时只能建立2个TCP连接 homekit2mqtt on DietPi Oracle 12c client with .NET legacy Oracle driver Minimum setup for Apache+AD SSO Minimum configuration for openldap to proxy multiple AD into a single search base 排列组合算法(PHP) Make Notepad++ auto close HTML/XML tags after the slash(the Dreamweaver way) ASDM through site to site VPN - Amonw's Weblog PHP, LDAPS and Apache DFS security warning and use group policy to set up internet security zones Refresh recovery area usage data after manually deleting files under recovery area Create Oracle Enterprise Manager repository data after restore a database from another server Restore Oracle database to another server .PRT extension and multiple NX versions Fix network adapter not present problem in cloned CentOS NX 8.5 License Server Firewall Setting Cisco ASA intra-interface routing How to configure windows machine to allow file sharing with dns alias (CNAME) Install unifi controller on CentOS
.Net Trace->Listeners->Remove
Amonw's Weblog · 2017-05-04 · via 博客园 - Amonw's Weblog

今天在调试一个别人写的ASP.NET老程序,log文件怎么都写不了。web.config里的trace->listeners里有这么一行:

<remove type="System.Diagnostics.DefaultTraceListener"/>

注释掉就好了。google了一下,很多例子都是这样写的,甚至MSDN上也有这样的例子:

https://msdn.microsoft.com/en-us/library/system.diagnostics.defaulttracelistener(v=vs.71).aspx

不过这些例子都是很多年前的了。查MS关于remove的文档:

https://msdn.microsoft.com/en-us/library/w11c2b46(v=vs.110).aspx

remove的参数应该是name而不是type。把上面那行改成:

<remove name="Default" />

就好了。

或者也可以在listeners的第一行用

<clear/>

清掉所有的listener然后再添加自己的。