Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 30 2019 09:25
    haf commented #351
  • Jan 30 2019 09:24
    haf edited #351
  • Jan 30 2019 09:24
    haf edited #351
  • Jan 29 2019 23:09
    rtkelly13 starred logary/logary
  • Jan 29 2019 08:14

    haf on master

    Add System.Data.Odbc to depende… (compare)

  • Jan 29 2019 02:25
    jburman starred logary/logary
  • Jan 28 2019 11:01

    haf on master

    Correcting copy target in Docke… (compare)

  • Jan 28 2019 11:00

    haf on master

    Remove stray extra find stanza … (compare)

  • Jan 28 2019 10:58

    haf on master

    Let Dockerfile copy the artifac… (compare)

  • Jan 28 2019 10:50

    haf on master

    Quicker builds with pre-downloa… Dockerfile with Rutta publish s… (compare)

  • Jan 27 2019 13:01
    haf edited #385
  • Jan 27 2019 12:52

    haf on master

    Test with better .dockerignore … (compare)

  • Jan 27 2019 00:02

    haf on master

    Makefile targets (compare)

  • Jan 26 2019 22:56

    haf on master

    Remove legacy/ folder; noone ha… Remove stray duplicate Version … Remove extra print of locales and 5 more (compare)

  • Jan 26 2019 20:56

    haf on master

    Fix LC_ALL warning from perl (compare)

  • Jan 26 2019 20:35

    haf on master

    Working Dockerfile build and ma… (compare)

  • Jan 26 2019 19:13
    tallpeak starred logary/logary
  • Jan 26 2019 19:02
    haf opened #385
  • Jan 26 2019 18:59

    haf on master

    Add RELEASE_NOTES note and Dock… (compare)

  • Jan 26 2019 18:20
    haf closed #383
Mario Meyrelles
@mariomeyrelles
as an outcome of this conversation and help, maybe it would be great to add some documentation
to help newbies like me
Adam Chester
@adamchester
Yep definiately this scenarios needs a good sample :thumbsup:
Mario Meyrelles
@mariomeyrelles
I'll try to help with this
this is an idea of a brief documentation to help in this scenario we discussed today
Honza Brestan
@jbrestan
Hi everyone! I have a sort of related question to the one above. I've updated Suave to >=2.0.0 which uses Logary.Adapters.Facade. I've got the facade working but I need to log to a file, preferably using NLog. Logary.Targets.Nlog seems to be gone in 4.x though... Is it no longer supported, or will it eventually be back?
Adam Chester
@adamchester
Hi @jbrestan is there some specific reason you want to go via nlog?
I'm sure if there's enough interest in the nlog adapter somebody will help get it going again :+1:
Honza Brestan
@jbrestan
Hmm, not very specific except NLog being well battle-tested so to speak. Are there alternatives? Logary File target states it's "alpha level" which tells me I probably shouldn't rely on that for deployments outside ofeasy direct supportability/operations access, which is this case...
Honza Brestan
@jbrestan
With previous Suave versions it was easy to create a thin wrapper around NLog for the logging interface, but now with the Facade, I'd have to deal with the message formatting, which would be more code than the rest of this Suave server
Working around the message value templating and adapting to the Facade myself is basically the only reason for me to use Logary and Logary.Adapter.Facade in this case
Or maybe I have missed something, but seems the formatting/templating is internal
Adam Chester
@adamchester
@jbrestan regarding the facade/templating, I’d be interested in solving this issue if theres a good solution. One thing we did was leave a generic TextWriterTarget in the Facade and if the message formats it generates are acceptable I can imagine it being really easy to adapt Suave->NLog ?
Adam Chester
@adamchester
The TextWriterTarget generates lines in similar ISO8601 format [I] 2014-04-05T12:34:56Z: Hello World! [my.sample.app]
Honza Brestan
@jbrestan
Can't say much about other use cases, but what would be 100% OK for mine would be a function in the Message module to fill in the templates in value from the fields map, as in the Facade Formatter module
Hmm, good point, I'll try playing with TextWriterTarget a bit more. I've tried before, but completely without the rest of Logary so I always ended up writing to disposed witers because of the asynchrony etc
Adam Chester
@adamchester
Yeah the Message->string conversion still needs a goal (e.g. if it’s for log files, the goal would be formatting dates in UTC, numbers in invariant culture, and so on)
Honza Brestan
@jbrestan
True, it probably gets more complicated for general usage
Adam Chester
@adamchester
LiterateConsoleTarget for example makes display a priority (colours for data types, local times, local culture, etc)
Short term easy solution might be TextWriterTarget -> simple nlog adapter
if you have an idea of the goal and issues involved in Message->String it would be great if you can write down some ideas in a github issue? :+1:
maybe TextWriterTarget is still a decent option, just that we don’t expose a way to create a decent custom formatter yet
(because as you mentioned, the template stuff is internal)
Adam Chester
@adamchester
Actually I can see an issue with text writer target that makes it inappropriate for this scenario, it's a character stream (writing text) and wouldn't be easy to decide when to write a log entry to nlog
So text writer won't help here, you do need message->string in a format suitable for text loggers
Honza Brestan
@jbrestan
I think I could inherit TextWriter and as a short-term solution rely on the implementation detail that TextWriterTarget only uses WriteLine(String) overload, and do the NLog delegation there. Still would need to map log levels etc. somehow though...
I'll go try it out, and I'll think about the possible Message->String function goals. Thanks a lot for the help!
Adam Chester
@adamchester
:+1:
Chet Husk
@baronfel
anyone here using the Zipkin functionality? I'm looking for a usage example to help wrap my mind around it
Henrik Feldt
@haf
@jbrestan wouldn't it be better for everyone if we work on the file target instead? In my world alpha means no known bugs, so it's not like it doesn't work. There is no file rotation support yet though.
Anders Elvik
@AElvik

Hi. I'm having some trouble installing Logary using Paket. The required Hopac version requires a newer FSharp.Core than Logary and Suave
Paket the atempts to resolve the versions, printing messages like:

Could not resolve package FSharp.Core:
    - Hopac 0.3.23 requested package FSharp.Core: >= 4.0.1.7-alpha
    - Logary 4.0.112 requested package FSharp.Core: >= 4.0.0.1 (no prereleases)
    - Suave 2.0.0 requested package FSharp.Core: >= 4.0.0.1 (no prereleases)

It ends up on Logary 4.0.112 and Hopac 0.3.14

  Paket version 3.33.3
  Main FAKE - 4.48
  Main Logary - 4.0.112
  Main Newtonsoft.Json - 9.0.1
  Main SQLProvider - 1.0.41
  Main Suave - 2.0

Mono 4.6.2

Is this a known issue?

Adam Chester
@adamchester
@AElvik i dont think its a known issue. Any chance you can put a repro on a github issue please?
Anders Elvik
@AElvik
Submitted #229
Adam Chester
@adamchester
@Haf logary/logary#228 the way we solve this general issue in message templates is only treating arguments specified with {@name} as 'object maps'
In message templates, IPAddress would be stringified early in the process
Yemi Bedu @ P&R
@pr-yemibedu
hello. what is a simple way to attach to a logger to get it to write to a file?
I am using expecto
Henrik Feldt
@haf
@pr-yemibedu Well, you could use the file logger.
You'll need to run the FacadeAdapter to change expecto to use Logary also.
file target*
a logger is just a reference to the logging infrastructure.
It's up to the logging infra to choose where to write
Yemi Bedu @ P&R
@pr-yemibedu
thank you @haf
is there a straight and simple example of getting the Expecto.Logging.TextWriterTarget or whatever is needed to write to a string buffer or to a file called "application.log"?
am I going about it wrong? I just want the text results of the test run so I can both save it to a text file and do a simple parse and format.
Adam Chester
@adamchester
@pr-yemibedu how about this?
expecto log to file.png
open Expecto

[<EntryPoint>]
let main argv = 
    use logFile = new System.IO.StreamWriter("testlog.txt")
    Logging.Global.initialiseIfDefault
        { Logging.Global.defaultConfig
            with getLogger = fun name -> Logging.CombiningTarget(name,
                                            [ Logging.TextWriterTarget(name, Logging.Verbose, logFile)
                                              Logging.LiterateConsoleTarget(name, Logging.Verbose) ])
                                         :> Logging.Logger
        }

    Tests.runTestsInAssembly defaultConfig argv
Yemi Bedu @ P&R
@pr-yemibedu
wow. thank you. that is amazing simple. I did have to read it about ten times. I am using an older version so I just translated as needed. @adamchester