Git Product home page Git Product logo

dialog's People

Contributors

greglook avatar ieugen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

sundbp ieugen

dialog's Issues

Is there a way to reload / update logging configuration at runtime?

Is there a way to update the logging configuration / levels at runtime without restarting the app?

I imagine this to be useful during long REPL sessions or even in production.

Is there a way to to the same by reloading the config on disk?
This is for OPS where no repl is available / desired.

In unix ops the process is usually:

  • send the app a SIGUSR signal
  • the app will read the file on disk and apply the configuration without downtime / connection closing.

I think for dialog is enough to implement logic to apply configuration changes.
Loading can happen on the client side.

Document how to send timbre logging to slf4j / dialog

I've asked this on clojurians slack, on #timbre just now.

We have an issue that I believe is caused by some libraries logging with timbre (not confirmed yet).

In our app if we load dialog ns first, logging works fine.
If we load another ns that uses tools-logging (which should work over slf4j / dialog) then logging from that ns does not appear.

Just started investigating this.

https://clojurians.slack.com/archives/C1J6MQC2H/p1686296806175059

Error building main - the commit on deps-deply does not exist.

Hi,

I noticed dialog depends on a deps-deploy commit hash that does not exist.
I tried current main.

./bin/build 
Error building classpath. Commit not found for slipset/deps-deploy in repo https://github.com/greglook/deps-deploy.git at a138ef59c1239336034c69624458f5b100ac835b

Is dialog a drop in replacement for timbre API ?

Hi,

We are using timbre and looking at dialog because we can't have unified logging with timbre.
We are using slf4j-timbre but I can't filter out apache loggers.
Also the library is not in sync with timbre and there is also fzakaria/slf4j-timbre#40 .

p.s. Implementing slf4j API I don't expect dialog to work in CLJS as timbre does.

Support event filtering per output

Hi,

I think for some use-cases, event filtering should be done per appender.
I noticed event filtering is done globally (see example in code) .

I remember logback / log4j allows setting the event filtering per appender.
This is explained here for log4j: https://logging.apache.org/log4j/2.x/manual/filters.html

dialog.logger ns doing global filtering with enabled?

(defn log-event
  "Pass an event into the logging system."
  [event]
  (when-not config
    (initialize!))
  (when-let [event (and (string? (:logger event))
                        (keyword? (:level event))
                        (enabled? (:logger event) (:level event))
                        (-> event
                            (apply-defaults)
                            (apply-middleware (:middleware config))))]
    (run!
      (fn write-event
        [[id output]]
        (when-let [event (apply-middleware event (:middleware output))]
          (write-output! id output event)))
      (:outputs config))))

[BUG] prep-ing the library fails because it wants JDK-8

Hi,

I'm using the slf4j branch in a project and I tried to prep it by running clojure -X:deps prep :aliases '[:dev]' .
However it fails because I am running on jdk-17 and it requires jdk-8.

This makes the library not usable via deps git integration.

The warning should be kept, but the exit should be removed IMO.
For my case it makes no sense - I am building it for my app - all app is built with jdk-17.
The check makes sense only for people doing releases.

(defn javac
  "Compile Java source files in the project."
  [_]
  (let [java-version (System/getProperty "java.version")]
    (when-not (str/starts-with? java-version "1.8")
      (binding [*out* *err*]
        (println "Dialog should be compiled with Java 1.8 for maximum"
                 "compatibility; currently using:" java-version))
      (System/exit 1)))

Before:

bb prep
Downloading: org/clojure/clojure/maven-metadata.xml from central
Downloading: org/clojure/clojure/maven-metadata.xml from clojars
Downloading: org/clojure/clojure/maven-metadata.xml from oss-snapshots-repo
Prepping amperity/dialog in /home/ieugen/.gitlibs/libs/amperity/dialog/d6569524ddc6f93eee9076054d9aa7887c8555fc
Dialog should be compiled with Java 1.8 for maximum compatibility; currently using: 17.0.5
Execution error (ExceptionInfo) at clojure.tools.deps/prep-libs!$fn (deps.clj:711).
Prep function could not be resolved: build/javac

Full report at:
/tmp/clojure-17842702112232980049.edn
Error while executing task: prep

After:

bb prep
Checking out: https://github.com/ieugen/dialog at 50fdfd3bacf4e86f1b82b3a9a3ea5e14fdbf974f
Prepping amperity/dialog in /home/ieugen/.gitlibs/libs/amperity/dialog/50fdfd3bacf4e86f1b82b3a9a3ea5e14fdbf974f
Dialog should be compiled with Java 1.8 for maximum compatibility; currently using: 17.0.5
โœ“ prep

Sentry appender

I would like to use this library but we use Sentry and we would need a sentry appender.
Does this library support this kind of extension?

I did not see anything in the docs.
The outputs seem to be a fixed list.
Nothing about adding your own: db, sentry, etc.

Is it possible to merge several configs?

Will be nice to merge two or maybe more config files.

I mean I have my own framework library with one dialog config. I want it to be default one for projects using this framework. And in final projects I want just reassign some config values. Is it possible? Now I have to copy/paste whole config and it is not very convient.

What is acme.logging in docs and examples?

In docs and examples you using middleware and initialize! function from acme.logging package. But I can't find something like that anywhere in internet. Please, clarify it. Thank you.

Can't disable logging from "com.zaxxer.hikari.util.DriverDataSource" via initialize!

Hi @greglook ,

I think I found a bug, related to : #23

I tried with initialize! and I can't seem to mask "com.zaxxer.hikari.util.DriverDataSource" .
Setting the level via (dialog.logger/set-level! "com.zaxxer.hikari.util.DriverDataSource" :info) works just fine.

p.s. I tried with both dialog commit 1dda8ccdd5172113c126df2a0c5dd1ae31332127 and also my slf4j-2 branch.

I have a project that uses github.com/stuartsierra/component and hikari db pooling library.

  • Default level is debug

I start the app and I see this line:

13:11:16.041 [nREPL] DEBUG com.zaxxer.hikari.util.DriverDataSource  Loaded driver with class name org.postgresql.Driver for jdbcUrl=REDACTED
  • I changed the level for "com.zaxxer.hikari.util.DriverDataSource" to :info / :error in dialog.edn
  • Ran initialize! and checked config is loaded in dialog.logger/config .
  • Stopped and started my system.
  • Logging line is still in the logs

Adding line to dialog.edn + reloading config does not change logging in existing repl.
Repl needs to be restarted for this to work.

{ :level :debug
 :levels {"dre" :info
          "io.netty" :info
          "com.zaxxer.hikari.pool" :info
          "org.apache.jena" :info
          "com.amazonaws" :info
          "com.zaxxer.hikari.HikariConfig" :error
          }
 :blocked #{"org.apache.http"
            "org.apache.parquet"
            "software.amazon.awssdk.profiles.internal.ProfileFileReader"
            "com.amazonaws.auth.profile.internal.BasicProfileConfigLoader"}
 :outputs {:dev {:type :print
                 :stream :stdout
                 :format :pretty
                 :padding false
                 :timestamp :short}}}

My deps.edn :

                   amperity/dialog {:git/url "https://github.com/amperity/dialog"
                                                               :sha     "1dda8ccdd5172113c126df2a0c5dd1ae31332127"}
                                              org.slf4j/log4j-over-slf4j               {:mvn/version "1.7.30"}
                                              org.slf4j/jul-to-slf4j                   {:mvn/version "1.7.30"}
                                              org.slf4j/jcl-over-slf4j                 {:mvn/version "1.7.30"}

{:jvm-opts [ "REDACTED"
                  "-Dclojure.tools.logging.factory=clojure.tools.logging.impl/slf4j-factory"]}

tests fail because of formatting ignores localisation (uses platform localisation)

Running the tests on my system, I have a failure because of the decimal separator in (123,456 ms).

FAIL in dialog.format.simple-test/message-formatting (simple_test.clj:38)
with duration
Expected:
  "2021-12-27T15:33:18Z [main]                   WARN  foo.bar.baz                     Another thing (123.456 ms)"
Actual:
  -"2021-12-27T15:33:18Z [main]                   WARN  foo.bar.baz                     Another thing (123.456 ms)"
  +"2021-12-27T15:33:18Z [main]                   WARN  foo.bar.baz                     Another thing (123,456 ms)"
28 tests, 210 assertions, 2 failures.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.