Skip to content

Instantly share code, notes, and snippets.

@Thorium
Last active December 19, 2015 10:42
Show Gist options
  • Save Thorium/ca7a9e8a6c6f3cbe8778 to your computer and use it in GitHub Desktop.
Save Thorium/ca7a9e8a6c6f3cbe8778 to your computer and use it in GitHub Desktop.
Simple example for Logary docs
open System
open System.IO
open Logary
open Logary.Configuration
open Logary.Targets
open Logary.Metrics
#if INTERACTIVE
#else
[<EntryPoint>]
#endif
let main args =
let logary =
withLogary "MyProject" (
withTargets [
Logary.Targets.TextWriter.create
(TextWriter.TextWriterConf.Create(
File.AppendText "happy.log",
File.AppendText "sad.log")) "filelogger"
] >> withRules [
Rule.createForTarget "filelogger"
]
)
let logger = Logging.getCurrentLogger ()
LogLine.info "Hello World!" |> logger.Log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment