Opened 8 years ago

Closed 8 years ago

#1517 closed enhancement (done)

Switch Tracing from log4net to Diagnostics.Trace

Reported by: ascheibe Owned by: ascheibe
Priority: medium Milestone: HeuristicLab 3.3.5
Component: Tracing Version: 3.3.5
Keywords: Cc:

Description (last modified by ascheibe)

Hive sandboxing executes code in an AppDomain with restricted privileges. All code that is executed in such an environment is partially trusted. This makes it possible to restrict permissions and define what code is allowed to be executed. log4net contains code that needs fully trusted callers. Because the code in a sandbox is executed partially trusted, log4net can't be used with Hive sandboxing. System.Diagnostics.Trace can be used with Hive sandboxing as it requires no fully trusted caller. Therefore the Logger class in Tracing will be rewritten to use Diagnostics.Trace. Configuration of the Tracing is done in app.config under the <system.diagnostics> Tag. To include this section in HeuristicLab's app.config, ConfigMerger has to be changed to also merge the <system.diagnostics> section. The log4net plugin will be removed from HeuristicLab as it is only used by HeuristicLab.Tracing.

Change History (6)

comment:1 Changed 8 years ago by ascheibe

  • Status changed from new to accepted

comment:2 Changed 8 years ago by ascheibe

r6173

  • rewrote Logger to use Diagnostics.Trace
  • removed HiveLogger as it's not used anymore
  • removed dependency from Persistence to log4net
  • ConfigMerger now also merges <system.diagnostics> sections

comment:3 Changed 8 years ago by ascheibe

  • Description modified (diff)

I made an error in the description of this ticket. I overlooked that HeuristicLab.SharpDevelop has a dependency on log4net. ICSharpCode.SharpDevelop.Dom uses log4net quite a bit, so the log4net plugin can't be removed.

comment:4 Changed 8 years ago by ascheibe

  • Owner changed from ascheibe to epitzer
  • Status changed from accepted to reviewing

comment:5 Changed 8 years ago by epitzer

  • Owner changed from epitzer to ascheibe
  • Status changed from reviewing to readytorelease

Good work. Thank you!

The log looks almost the same as before and also works for release builds. We lose the rolling file functionality of log4net, but I think it is not a big deal.

I have completely removed the user settings which are no longer required and used string formatting instead of concatenation in (r6179)

comment:6 Changed 8 years ago by swagner

  • Resolution set to done
  • Status changed from readytorelease to closed
  • Version changed from 3.3.4 to 3.3.5
Note: See TracTickets for help on using tickets.