Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Setup()
- Dim hierarchy = CType(LogManager.GetRepository(), Hierarchy)
- Dim patternLayout = New PatternLayout()
- patternLayout.ConversionPattern = "%date [%thread] %-5level %logger - %message%newline"
- patternLayout.ActivateOptions()
- Dim roller = New RollingFileAppender()
- roller.AppendToFile = False
- roller.File = "C:EventLog.txt"
- roller.Layout = patternLayout
- roller.MaxSizeRollBackups = 5
- roller.MaximumFileSize = "1GB"
- roller.RollingStyle = RollingFileAppender.RollingMode.Size
- roller.StaticLogFileName = True
- roller.ActivateOptions()
- roller.Name = "Log"
- hierarchy.Root.AddAppender(roller)
- Dim t = New LoggerMatchFilter()
- t.LoggerToMatch = "Log"
- t.AcceptOnMatch = True
- roller.AddFilter(t)
- hierarchy.Root.Level = Level.All
- hierarchy.Configured = True
- End Sub
Add Comment
Please, Sign In to add comment