Comments (12)
Hmm, I'll have to take a look and do some testing. Feel free to create a PR here: https://github.com/outr/perfolation if you're interested in helping fix it.
from scribe.
Noticed two things:
- This is a transitive issue from perfolation
- Setting
java.util.TimeZone.setDefault(java.util.TimeZone.getTimeZone("UTC"))
gives me the desired behaviour, but as a JVM-wide global it's quite scary to set.. 😬
from scribe.
A better solution perhaps would be to add the zone offset at the end of the string according to ISO8601-standards 🤔
from scribe.
Can you clarify which log formatting you are using?
from scribe.
Also, are you logging on JVM, JS, or Native?
from scribe.
Can you clarify which log formatting you are using?
Also, are you logging on JVM, JS, or Native?
Using FormatBlock.Date.ISO8601
on JVM, although I'm assuming the outcome should be identical across all platforms.
from scribe.
It should be, but the implementations are different.
from scribe.
Correct me if I'm wrong here, but the problem isn't Perfolation; it's that I'm hard-coding Z
on the end of the formatted stamp when it's local time. Would it be acceptable to just fix the suffix to output the proper timezone? Then, if you want to use UTC you can set the default timezone, or just leave the default and it will be the machine's local zone.
from scribe.
my proposed solution is just to replace "Z" in FormatBlock:74
to be ${l.t.Z}
from scribe.
@megri please let me know if this solution is acceptable to you.
from scribe.
@darkfrog26 I wasn't paying attention to this. I'm sorry. Fixing the output to use the proper timezone would definitely be preferable.
my proposed solution is just to replace "Z" in FormatBlock:74 to be ${l.t.Z}
That would be great. Note I tried reading up on how to properly format this but my reference actually doesn't seem to acknowledge this format. It's definitely better than hard-coding a Z though.
As an aside I tried using ${l.t.z}
to get a zone offset — which IS mentioned in the reference — but it seems the implementation is broken as I got output looking like 2024-05-02T14:09:43 +-2-120 [INFO] <empty>.JGit.JGit:37 - this is a test!
from scribe.
This works though:
val z =
val ms = l.t.timeZoneOffsetMillis
val sign = if ms < 0 then "-" else "+"
val HH = Math.abs(ms) / 3600000
val MM = Math.abs(ms) / 60000 % 60
f"$sign$HH%02d$MM%02d"
from scribe.
Related Issues (20)
- Unable to have minimumLevel=Info and only enable Trace for certain packages HOT 11
- Overriding the path for log files HOT 4
- Help: configure stdout/stderr in function of LogLevel HOT 15
- Compare perfomance with Chronicle-Logger HOT 2
- NPE when logging with SLF4J and Throwble == null HOT 4
- Different versions of scala-collection-compat pulled in transitively HOT 3
- Logger ignores `data` field HOT 3
- AsynchronousLogHandle shutdown hook HOT 3
- MDC syntax improvement HOT 7
- Standardize JSON output ? HOT 3
- Is it safe to use MDC with cats-effect? HOT 5
- Logging stderr HOT 2
- ScribeCirceJsonSupport does not output stack traces for Exceptions HOT 2
- Minimal example for JSON logging: Is this okay? HOT 2
- Allow scribe.fatal HOT 2
- `scribe-slf4j` does not support `slf4j-api` 2.x and `scribe-slf4j18` does not exist HOT 4
- How to integrate with scala-play HOT 3
- Error on cross linking with scala 2.12.19
- Bump scala-collection-compat dependency to 2.12.0 (fix Scala Native 0.5 support) HOT 2
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 scribe.