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
seems to be preferred way to log, at least, as per documentation and haf's works on other projects like Expecto, who also uses the same idea of Facade for logging
Adam Chester
@adamchester
still a good question: how do we prevent Suave->Facade Adapter->Logary from wasting time logging things
Mario Meyrelles
@mariomeyrelles
this is a possible issue on github
I just don't know how to formalize this
Adam Chester
@adamchester
Not sure about formalising.. it looks fairly clean now ?

let logary =
    withLogaryManager "TestApi" (
        withRule { Rule.createForTarget "console" with level = Info }
        >> withTarget (LiterateConsole.create LiterateConsole.empty "console")
    ) |> run

let logaryLogger = Logging.getCurrentLogger ()
…
LogaryFacadeAdapter.initialise<Suave.Logging.Logger> logary
startWebServer defaultConfig (testApi)
perhaps you meant “formalise” the discussion about how to make sure Suave only logs at the correct level to Logary?
for all I know, it does that already. Maybe @haf has some magic to do it already
Mario Meyrelles
@mariomeyrelles
yes - the issue of Suave sending everything instead of sending only the correct log level
Mario Meyrelles
@mariomeyrelles
but to be honest, the solution you found is the best - very clean, simple and allows for custom logging also
what do you usually use to work in Logary, Suave and so on? The combination of VsCode, Ionide, Fake and Paket?
(sorry for the offtopic/newbie question)
Adam Chester
@adamchester
lately I try to use vscode more often yeah
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