Is there a %date{xxx} that can give me the seconds since epoch? #967
                  
                    
                      ecerulm-st
                    
                  
                
                  started this conversation in
                General
              
            Replies: 1 comment
-
| I wrote #967 to add  | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
From https://logback.qos.ch/manual/layouts.html I can see that I can use
%date{xxx}where xxx is ajava.time.format.DateTimeFormatter. But it DateTimeFormatter does seem to have any way to output "epoch seconds", does it?I'm after something like the configuration below, specifically the
timestampSecondsfield:I've tried with
but unfortunately the
UNIX_TIMESTAMP_AS_NUMBERgives milliseconds from the epoch and not seconds from the epoch and I don't see any way to convert that to seconds from the configIs there any way to get the epoch seconds from
%dateor anywhere else?Beta Was this translation helpful? Give feedback.
All reactions