## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### 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

• 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
dylanbevandotnet
@dylanbevandotnet
Thanks @haf , I had a momentary brain fart. After I posted I realized that it was up to the target to aggregate. Thanks for the video pointer I'll go check it out.
dylanbevandotnet
@dylanbevandotnet
Ok so new question now. If I have a popular shopping site and I declare an event that happens everytime someone buys a product (Message.Event Info "{item} Purchased"), what are my options for creating a derived metric that could aggregate the total number of purchases in the tick interval, as well as the counts per item? Basically do I have to increment a specific item purchased gauge AND send an event (to get full details), with a derived metric accumulating all the specific item gauges.
OR can I create derived metrics off the event. I'm not seeing a way to do that through the API but maybe I'm missing something obvious. Thanks
Henrik Feldt
@haf
@dylanbevandotnet You can either pass the values to a Metric, which in turn yields Derived values. There's a sample of that in the samples folder/project. Or you can create a Message every purchase with the data you need and have the targets ship to where you need; like Influx – and let Influx do the aggregation for you.
Tuomas Hietanen
@Thorium
I made a PR for AppInsights. If you have ideas how to also use AppInsights performance logging measurement features, that would be nice. Now it's just creating bulk trace items.
And that should be released as a separate nuget package I suppose, as it creates a new dependency
Henrik Feldt
@haf
Thanks @Thorium
I've replied to your architecture question
James Freiwirth
@endeavour
Is there a way to automatically add a field to every log message?
Henrik Feldt
@haf
Yes
Middleware.
With config or with Logger
Logger.apply (setFieldName "myField" myobj) logger
or Config.withMiddleware
Jimmy Byrd
@TheAngryByrd
@haf what's your preference for netfull/netstandard support? 1 fsproj to rule them all or two separate fsprojs, 1 old 1 new with mergenuget thing?
Henrik Feldt
@haf
Hi there. I prefer a single command to build them both, if that command isn't buggy....
I saw Alfonso complaining the other day about interference between different .net core sdk versions when building
But I generally am fine with either way, again, as long as it's scriptable and it's easy to create nugets to release with it.
Joerg Beekmann
@jbeeko
Hi There. I've been trying use the ApplicationInsights target. I tried to replicate this script but open Logary.Targets.ApplicationInsightsdoes not compile because ApplicationInsights is not a module in the Logary.Targets namespace. What am I missing?
Joerg Beekmann
@jbeeko
Never mind, I see now I need to get the Logary.Targets.ApplicationInsights package. I expect with that I'll get further.
btrepp
@btrepp

I may be missing something obvious here, but is there a point free constructor for the message factory?.
LogLevel -> Message
but all the functions to make a message is of the form
message.event ->LogLevel->string->Message
So I feel like I have to write
do! Logging.log Info (fun l -> Message.event l "template |> Message.setField...)
I'd much rather
do! Logging.log Info (Message.fromtemplate "template >> Message.setField ... )

It also leads me to believe I'm possibly created log entries the wrong way?.

Jimmy Byrd
@TheAngryByrd
@btrepp do you have Message.eventInfo and friends? Should be similar to what you want. I've also just been using logSimple as it uses the Messages LogLevel
Jimmy Byrd
@TheAngryByrd
if I want to create a rule for a specifichiera like Npgsqland set it to Info and leave the rest as Debug how would I go about that? This doesn't seem to work for some reason.
                Rule.createForTarget ("console")
|> Rule.setHieraString "Npgsql"
|> Rule.setLevel LogLevel.Info
Rule.createForTarget ("console")
|> Rule.setLevel LogLevel.Debug
btrepp
@btrepp

@TheAngryByrd I've seen them, but they seem to curry it even more
Eg the log factory would want to ignore the first argument of log level.

Atm I've been creating point free like functions as needed, but I'm still trying to figure out what would be 'idiomatic' logary

Tbh it seems like most people would use logSimple, but I'm actually inside a Hopac Job, and waiting for it to at least be buffered or committed is the behaviour I am chasing
btrepp
@btrepp
Ahh it seems to be called Message.eventX
Henrik Feldt
@haf
@btrepp logger.info (eventX "Thing {happened}" >> setField "happened" 42)
That buffers in the job scheduler.
logger.infoWithBP buffers in RingBuffer ahead of each target (and you can continue/job is done) after ALL targets have this message in their ring buffers (but not taken it yet)
logger.logWithAck gives an Alt which gets committed when the RingBuffer of all targets has accepted the message and its inner value is a promise that gets committed/a value when all targets have flushed the log message.
You need to open the Message module in Logary to get the 'nice idiomatic usage.
btrepp
@btrepp
Thanks @haf.
btrepp
@btrepp
Really digging those Ack/Hopac based methods, most of where I want logging is in the IO realm, which I'm using hopac jobs as a surrogate for
btrepp
@btrepp
Is it possible to use the shipper to ship logs to a process that stores them all in an SQL database? It seems this might be possible with the Rutta process?, is there a binary available or do I need to compile it?
btrepp
@btrepp
ah looks like the SQL target doesn't support serviceNames, so I might have to add that first
btrepp
@btrepp

Does current master build?. I'm getting errors when running the bundle exec rake

:\msys64\home\beau.trepp\net\logary\examples\Libryy\Libryy.fsproj: error : C:\msys64\home\beau.trepp\net\logary\examples\Libryy\Libryy.fsproj: C:\msys64\home\beau.trepp\net\logary\examples\Libryy\Libryy.fsproj could not import "\$(FSharpTargetsPath)"
Configuration: Release Platform: AnyCPU
BinaryAnnotation.cs(15,55): warning CS1570: XML comment has badly formed XML -- 'Reference to undefined entity 'rArr'.'`

Granted i'm using msys2 on windows, so theres probably a whole bunch of hell with ruby interacting with it

Henrik Feldt
@haf
Albeit not on Windows for Logary, because contributors haven't popped up on Windows.
Although you probably don't need to build the examples
btrepp
@btrepp
Ah I was going to try and get a dev environment up to try and do a PR for the migrations
You have a good point, I was just following the README and trying to initialize an environment to hack on :)
btrepp
@btrepp
Managed to get bits to compile, core tests run fine, DB tests throw {"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."} on the smoke test for what looks like an Sqlite in memory db on windows.
Henrik Feldt
@haf
@btrepp If I remember correctly those also get thrown from p/invoke on Win when you're running 32 bit code in 64 bit proc or vice versa.
btrepp
@btrepp
Mhmm I will have to play with that when I'm back at work and see what's going on
Is there any elegant way to wait for all the loggers to flush when I'm shutting down my application?
Henrik Feldt
@haf
Yes, there's a call called flush on the registry, but if you use the interface LogManager, Dispose() will wait for them all.
Ákos Lukács
@AkosLukacs
Hi !
Ákos Lukács
@AkosLukacs
Ah, so not compatible with NodaTime 2
Henrik Feldt
@haf
Hi there
Not yet, but soon
Tuomas Hietanen
@Thorium
what is the preferred workaround if I want to compile same web-server logic with .Net Framework and .Net Core, if I'm using Logary quite heavily? Should I just mock Logary calls with conditional compilation to aspnet-core-logging-dependency-injection-mess ?