Re: [D] Getting current date-time format (or default format) [logging-log4j2]

2025-06-27 Thread via GitHub
GitHub user ppkarwasz added a comment to the discussion: Getting current date-time format (or default format) If you chose the `-MM-dd HH:mm:ss,SSS` format because it was one of the few formats optimized for low garbage generation by `FixedDateFormat`, it's worth noting that this limitati

Re: [D] Getting current date-time format (or default format) [logging-log4j2]

2025-06-27 Thread via GitHub
GitHub user ppkarwasz added a comment to the discussion: Getting current date-time format (or default format) You might consider a different approach to keep the date format consistent between your application output and Log4j logs. Here’s a flexible strategy: 1. **Define a shared default fo

Re: [D] Getting current date-time format (or default format) [logging-log4j2]

2025-06-27 Thread via GitHub
GitHub user ashr123 edited a comment on the discussion: Getting current date-time format (or default format) in addition, why can't all the named patterns be an enum with 3 fields (base pattern, compact postfix and non-compact postfix) and a getter with `boolean compact` parameter that return

Re: [D] Getting current date-time format (or default format) [logging-log4j2]

2025-06-27 Thread via GitHub
GitHub user ashr123 edited a comment on the discussion: Getting current date-time format (or default format) Yes, certainly right now I execute the following code: ```java private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern( FixedDateFor

Re: [D] Getting current date-time format (or default format) [logging-log4j2]

2025-06-27 Thread via GitHub
GitHub user ashr123 edited a comment on the discussion: Getting current date-time format (or default format) Yes, certainly right now I execute the following code: ```java private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern( FixedDateFor

Re: [D] Getting current date-time format (or default format) [logging-log4j2]

2025-06-27 Thread via GitHub
GitHub user ashr123 added a comment to the discussion: Getting current date-time format (or default format) Yes, certainly right now I execute the following code: ```java private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern( FixedDateForm

Re: [D] Getting current date-time format (or default format) [logging-log4j2]

2025-06-27 Thread via GitHub
GitHub user ppkarwasz added a comment to the discussion: Getting current date-time format (or default format) > I'm not trying to introspect anything, but I do `println` (in addition to > logs) some data I got from `HttpClient` and I'm printing dates (as > Last-Modified) with the default patt

Re: [D] Getting current date-time format (or default format) [logging-log4j2]

2025-06-27 Thread via GitHub
GitHub user ashr123 edited a comment on the discussion: Getting current date-time format (or default format) in addition, why can't all the named patterns be an enum with 3 fields (base pattern, compact postfix and non-compact postfix) and a getter with `boolean compact` parameter that return

Re: [D] Getting current date-time format (or default format) [logging-log4j2]

2025-06-27 Thread via GitHub
GitHub user ashr123 edited a comment on the discussion: Getting current date-time format (or default format) in addition, why can't all the named patterns be an enum with 3 fields (base pattern, compact postfix and non-compact postfix) and a getter with `boolean compact` parameter that return

Re: [D] Getting current date-time format (or default format) [logging-log4j2]

2025-06-27 Thread via GitHub
GitHub user ashr123 edited a comment on the discussion: Getting current date-time format (or default format) in addition, why can't all the named patterns be an enum with 3 fields (base pattern, compact postfix and non-compact postfix) and a getter with `boolean compact` parameter that return

Re: [D] Getting current date-time format (or default format) [logging-log4j2]

2025-06-27 Thread via GitHub
GitHub user ashr123 edited a comment on the discussion: Getting current date-time format (or default format) in addition, why can't all the named patterns be an enum with 3 fields (base pattern, compact postfix and non-compact postfix) and a getter with `boolean compact` parameter that return

Re: [D] Getting current date-time format (or default format) [logging-log4j2]

2025-06-27 Thread via GitHub
GitHub user ashr123 added a comment to the discussion: Getting current date-time format (or default format) in addition, why can't all the named patterns be an enum with 3 fields (base pattern, compact postfix and non-compact postfix) and a getter with `boolean compact` parameter that returns

Re: [D] Getting current date-time format (or default format) [logging-log4j2]

2025-06-27 Thread via GitHub
GitHub user ashr123 added a comment to the discussion: Getting current date-time format (or default format) by the way, I've noticed that in `org.apache.logging.log4j.core.pattern.DatePatternConverter#decodeNamedPattern`, inside the switch-case `case "DEFAULT"`, you're using it again instead

Re: [D] Getting current date-time format (or default format) [logging-log4j2]

2025-06-27 Thread via GitHub
GitHub user ashr123 edited a comment on the discussion: Getting current date-time format (or default format) I'm not trying to introspect anything, but I do `println` (in addition to logs) some data I got from `HttpClient` and I'm printing dates (as Last-Modified) with the default pattern cau

Re: [D] Getting current date-time format (or default format) [logging-log4j2]

2025-06-27 Thread via GitHub
GitHub user ashr123 added a comment to the discussion: Getting current date-time format (or default format) I'm not trying to introspect anything, but I do `println` (in addition to logs) some data I got from `HttpClient` and I'm printing dates (as Last-Modified) with the default pattern caus

Re: [D] Getting current date-time format (or default format) [logging-log4j2]

2025-06-27 Thread via GitHub
GitHub user ppkarwasz added a comment to the discussion: Getting current date-time format (or default format) Thanks for the question! Could you tell us more about your use case? For example, are you trying to introspect the effective Log4j Core configuration at runtime, or are you attemptin

Re: [D] Support for template names [logging-log4net]

2025-06-27 Thread via GitHub
GitHub user FreeAndNil added a comment to the discussion: Support for template names Thanks for the detailed explanation and the sample app. I believe there might be a misunderstanding regarding how log4net handles message templates. The kind of structured logging you're describing (e.g., us

Re: [D] Support for template names [logging-log4net]

2025-06-27 Thread via GitHub
GitHub user martinRocks added a comment to the discussion: Support for template names Thank you for the quick reply. I have created a small demo app for how I have things configured. If I have anything set wrong, please let me know. I hope this helps explain my problem. I am surprised tha

Re: [D] Support for template names [logging-log4net]

2025-06-27 Thread via GitHub
GitHub user FreeAndNil added a comment to the discussion: Support for template names I am not aware of a possible solution to your problem. @gdziadkiewicz do you have an idea? GitHub link: https://github.com/apache/logging-log4net/discussions/261#discussioncomment-13599719 This is an au

Re: [D] Support for template names [logging-log4net]

2025-06-27 Thread via GitHub
GitHub user martinRocks edited a discussion: Support for template names When will log4net allow the use of template names? For example, a log message like this: ```_log.InfoFormat("Started {time}", DateTime.Now);``` so that the message comes out in Json format like this: ``` { "date": "2025-