Fork me on GitHub
#clojure-uk
<
2020-03-23
>
dharrigan06:03:39

Good Morning!

jasonbell08:03:42

Morning friends

guy10:03:20

Morning!

guy10:03:38

I have to say ive really liked the early hour for the elderly and vunerable at the supermarkets

guy10:03:08

I was waiting for the shops to open to general public today and was impressed that people werent kicking up a fuss

guy10:03:27

Its just nice to see something good happen haha

folcon12:03:29

Anyone have much experience with sente? Trying to work out why it keeps not working with mount

Gulli14:03:56

What are people using for logging? Timbre?

ataggart14:03:41

clojure.tools.logging delegating to log4j2 configured with a log4j.properties file.

dharrigan14:03:51

🙂 Hi Alex!

dharrigan14:03:58

I use that, but with logback

ataggart14:03:35

logback is configured with xml, right?

dharrigan14:03:53

but the configuration is very minimal

ataggart14:03:03

as it should be

ataggart14:03:35

some folks dislike xml

mccraigmccraig14:03:40

timbre has worked out pretty well for us

dharrigan14:03:49

I'm in the dislike with a passon xml

dharrigan14:03:32

but I tolerate a few things. I moved from log4j (when it was a 1 release) to logback years and years ago and had a good experience, inertia has prevented me from looking elsewhere

4
ataggart14:03:20

This is all I have.

ataggart14:03:27

yeah, I looked around when starting a new system, and the performance of log4j2 over everything else (and the non-xml option) sold me.

dharrigan14:03:33

<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="10 seconds">

    <statusListener class="ch.qos.logback.core.status.NopStatusListener"/>

    <variable name="ROOT_LOG_LEVEL" value="${ROOT_LOG_LEVEL:-info}"/>

    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <Pattern>[%boldWhite(%d)] --- [%boldBlue(%-5level)][%boldGreen(%-40.40logger{40})][%boldMagenta(%-4.4L)] - %msg%n%rEx</Pattern>
        </encoder>
    </appender>

    <root level="${ROOT_LOG_LEVEL}">
        <appender-ref ref="CONSOLE"/>
    </root>

</configuration>

dharrigan14:03:48

That covers nearly 100% of all the projects I work in

ataggart14:03:51

heh, basically the same

dharrigan15:03:12

Is log4j2 faster than logback thesedays?

ataggart15:03:18

they claim it is

dharrigan15:03:21

It was one of the reasons I moved to logback, since log4j1 was very slow

Ben Hammond15:03:24

rescan config file at runtime is the killer feature

👍 8
Ben Hammond15:03:37

would never want to be without that again

dharrigan15:03:53

Yes, that has come in very very handy lots of times

dharrigan15:03:59

and also the jmx configurator as well

rickmoynihan15:03:28

clojure.tools.logging here with slf4j/log4j2. I personally really don’t get on with timbre — but depends on what you want from logging.

rickmoynihan15:03:40

> some folks dislike xml I dislike it too; and all things being equal I should prefer timbre with edn config… however the truth is that slf4j/log4j2 via clojure.tools.logging are just far more mature, ship with better defaults, and give you better capabilities such as capturing logging with java libraries such as apache http-client which have been invaluable to us. Yeah you could do this with timbre too; but then you have your backends logging configuration and timbre’s too — it’s just redundant. Plus I found timbres defaults (at least via duct) in prod were horrible; e.g. the syntax colouring by default means tailing logs over ssh the logs are full of gunk… so I had to switch stuff like that off. Plus I ran into a few bugs back in the day; that are probably all fixed now but it felt it was just adding complexity for me. Especially given the log4j configs we need are typically pretty minimal.

Wes Hall15:03:10

I actually use slf4j-simple for most stuff. You can do the basic config with system properties, and it just works. Logging is by far the most over-engineered thing in the whole JVM ecosystem.

☝️ 8
mccraigmccraig15:03:06

@U06HHF230 we ended up using a timbre appender - just one lot of EDN config for all our clj + java logging

rickmoynihan15:03:46

@U0524B4UW yeah and that’s great — but if you want to log stuff in java libraries you’re using; and one library uses log4j and the other java.util.logging; you really don’t want to add timbre too.

mccraigmccraig15:03:32

oh, i think we intermediate with slf - so our clj timbre client uses an slf backend, and our slf uses a timbre appender. it's been a while since i looked at the details, so i'm a bit hazy tbh, but we successfully capture logging from lots of java libs without having to make any code changes

ataggart15:03:22

I've made some regretable technical decisions in my career, but keeping clojure.tools.logging as an abstraction and away from being a logging implementation is not one of them. 🙂

☝️ 4
rickmoynihan15:03:42

@U9HA101PY I don’t think java logging is particularly over engineered. Yeah nobody likes how the ecosystem is; and if sun had just include java.util.logging before log4j etc and it had been established; things would be fine… but given we have multiple frameworks now… I think it’s engineered to the right level… it’s just now a complicated problem 😞

rickmoynihan15:03:51

Yeah I’ve used that too

Wes Hall15:03:30

@U06HHF230 Yeah, I don't really mean that anybody set out to over engineer it, and you're quite right it was the intro of JUL that really started the whole mess. Whatever you call it though, over-engineered, over-complex etc... this is now a near 40 post thread while we discuss the ways we write lines of text to a file... something perhaps of a case-in-point 🙂

rickmoynihan15:03:01

Yeah I don’t disagree with that

Gulli11:03:48

@U5ZNLFCQ7 With your setup, are you able to dynamically change logging levels in production?

ataggart12:03:16

@UQXS91RT7 Yes, insofar as changes to the log4j2.properties file will be reloaded if given a monitorInterval. There might be a way to do it via JMX, but I haven't had to look into it yet.

dharrigan15:03:33

With JMX yes, I do it in production by exposing the JMX port

dharrigan15:03:36

(internal only)

dharrigan15:03:40

so I can adjust if required.

dharrigan15:03:44

that's what I do

Gulli16:03:54

Still deciding between frameworks though. @U5ZNLFCQ7 is your properties file external to the uberjar? @U11EL3P9U interesting, might look at that

ataggart16:03:10

Yes, all configuration is external (not just logging), and their locations specified at runtime via system properties.

ataggart16:03:33

Though for production use of mucking about with logging config, I'd go with the JMX approach.

Gulli16:03:38

How do you specifically specify the location?

dharrigan14:03:41

Clojure Tools Logging

Ben Hammond14:03:58

Miaow > Apache Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many of the improvements available in Logback while fixing some inherent problems in Logback’s architecture.

Ben Hammond14:03:24

I've not tried log4j2, must be time to check it out

seancorfield15:03:33

We were using Timbre for years, but a while back we switched everything over to log4j2, with clojure.tools.logging.

seancorfield16:03:29

(we weened ourselves off all of the taoensso libraries over a period of several months -- just seemed like a lot of code for stuff that didn't really need all that configurability/customization)

dharrigan16:03:39

I use the taoensso library for i18n - tempura - works well. That's the only one I use 🙂

dharrigan16:03:36

How's everyone doing with working from home? So far so okay for moi 🙂 Although with a young kid, it's going to be an endurance if this stretches out for months...

mccraigmccraig16:03:39

i work from home anyway, so plus ça change

rickmoynihan16:03:33

Good at the minute — but wfh’d a lot anyway, though I am missing going in to the office. Not sure how it’ll be with nurseries when my wifes mat leave ends; in a few weeks still not heard what they’re planning; whether we’re obliged to still pay them to hold a place etc… She’s a probation officer and should be classed as a key worker though, so maybe places will be available but not sure I want to be mixing large groups of children right now anyway.

👍 4
Gulli17:03:12

I've been working remotely for 3 years, no biggie for me really

😄 4
seancorfield17:03:16

I've been working from home for thirteen years now (with about 18 months in there where I had to go into a local office a few days a week). My wife's climbing the walls a bit tho'... her routine was an hour or two down the gym every morning and of course... no more of that...

seancorfield17:03:05

I just spoke to my mum and she says the UK has said restrictions will be in place for twelve weeks? (at least)

Gulli18:03:48

That's what I've heard

Eamonn Sullivan18:03:48

I've never worked from home for longer than 2-3 days in a row, but in a previous career as a journalists I had to work outside of the office for long stretches. This wasn't home-working, though, it was working in coffee shops, libraries, or whatever. Having a home office where I go every day is quite a different experience for me. I'm on week two. Still doing OK. Haven't gone nuts yet.

dharrigan19:03:23

Yeah, Boris is holding an unscheduled conference at 20:30 this evening

dharrigan19:03:30

I strongly suspect lockdown.

dharrigan19:03:37

I think there may be a rush on the supermarkets

dharrigan19:03:42

Last time I worked from home was a few years ago, for a full year. This is the first time since then for an extended duration with a 3 year old in tow too!

dharrigan19:03:46

interesting times!

mccraigmccraig20:03:15

about f**n' time

truestory 8
Ben Hammond20:03:13

you get out once a day to take your constitutional

dharrigan20:03:21

Police will have powers to stop and ask, I'm sure the details will come out in a bit (including the full terms, i.e., fines etc..)

thomas20:03:09

NL hasn't gone into complete lockdown yet.

thomas20:03:21

but all larger gathering are banned etc.

dominicm21:03:03

Damn. I need to get ginger for dinner tomorrow.v they were out today!

dominicm21:03:16

Can deliveroo do supermarkets yet?

alexlynham23:03:09

in some areas of the uk, deliveroo will shop certain items from yr local coop

alexlynham23:03:24

or at least they did when I was there

guy07:03:48

Ive seen that as well in london. They can go buy you some beers from your local offy

Ben Hammond21:03:29

I think you can go out to get food

dominicm21:03:12

Yeah, but everyone else will be doing that!

dharrigan21:03:27

My wife is of the opinion there will be a massive baby boom in 9 months. After all, once you've both binge watched all of netflix, amazon, hulu, disney+, apple tv...what then??...what then??

alexlynham23:03:04

nah, in 18 mths as pregnant women are higher risk. I reck people will wait til corona is past

alexlynham23:03:15

(but there will be a boom for sure)

dominicm22:03:07

Facebook is full of that

dominicm22:03:27

Good time to invest in a condom company?

mccraigmccraig22:03:37

does anyone here have any experience with K8S/EKS auto-scaling ?

dominicm23:03:33

I misread entirely 😂

4
alexlynham23:03:09

in some areas of the uk, deliveroo will shop certain items from yr local coop

Gulli16:03:38

How do you specifically specify the location?