Comments (6)
It depends on the perspective:
- devops
ENABLE_LOGA=true
- devs
ENABLE_LOGA=false
Devs perspective was prioritised over devops because of the frequency how often devs will install project. The idea was - "User should not noticed the library unless explicitly decide to". Also, I think that devops will write configuration anyway so can easily add it.
On the other hand having it setup to true by default will reduce probability of error, when the env var will be missing and thats much more important then dev settings.
I have no strong opinions about this and we can change it as you suggested
Thoughts? :)
from clj-loga.
Hmm, I guess the JSON would make it a bit annoying to read the logs.... I guess I don't have hugely strong feelings then, other than it's probably slightly easier to set an env var in dev than in uat/staging/production... (could be done in the project.clj
) - and as you point out, having it default to true will reduce the probability of error.
from clj-loga.
Prefer to have sane defaults for developers. Its easy enough for the devops team to set environment variables.
from clj-loga.
Fair enough, closing this.
from clj-loga.
@stuart-robinson, @rsslldnphy - We had quite an issue recently with an internal application. In the end we failed to find anything and we lost decent amount of time because loga
has been enabled in the code, but the environment variable was missing.
It is much harder for the developer to miss configuration in his local environment than missing configuration in production code. Also consequences are much more severe in the later case. This is a one-time setting that can be included in ~/.lein/profiles.clj
file to be shared accross all the projects.
Another option - in development, we run applications using leiningen. Can we just upload the library to detect that leinigen is running? It sets up number of environment variables which does not appear in non-leiningen runs (LEIN_VERSION for example). Obviously it does not guarantee anything if someone decide to live without leiningen and will be a terrible idea if we ever had a moment of brilliance and run leiningen in prod, so I am sort of against my own idea here. :P
from clj-loga.
@broi-fc is right and this should be addressed. Loga can be dynamically allowed, or not based on environment variable and maybe if its not.
instead of
(defn- loga-enabled? []
(= (env :enable-loga) "true"))
can be something like
(defn- loga-enabled? []
(not= (env :lein_env) "dev"))
from clj-loga.
Related Issues (11)
- Use new clj-loga library for JSON logging goodness! HOT 1
- Obfuscate sensitive information HOT 2
- Specify log level via environment variable HOT 4
- ENABLE_LOGA doesn't seem to exist HOT 3
- Exception message and `ExceptionInfo`'s metadata should be logged HOT 2
- Incorrect license
- Error when serialising objects
- If logging an exception without a custom error message use message from exception HOT 1
- Use of `env` in top level `def` will break under some circumstances. HOT 2
- May want to investigate RobertHooke lib for aspect-oriented logging HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clj-loga.