在log4net.config中

1     <parameter>
2       <parameterName value="@czyid" />
3       <dbType value="Int32" />
4       <layout type="log4net.Layout.PatternLayout">
5         <conversionPattern value="%property{czyid}" />
6       </layout>
7     </parameter>

在使用的类中为其赋值:

1  log4net.LogicalThreadContext.Properties["czyid"] ="2";

 

相关文章:

  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
  • 2022-12-23
  • 2021-06-15
  • 2021-11-15
猜你喜欢
  • 2022-02-10
  • 2022-03-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
相关资源
相似解决方案