# Add Timestamps to Vapor Logs - How To?

**URL:** <https://forums.swift.org/t/add-timestamps-to-vapor-logs-how-to/80643>\
**Category:** Server\
**Tags:** vapor, logging\
**Created:** [June 24, 2025, 5:40pm UTC](https://forums.swift.org/t/add-timestamps-to-vapor-logs-how-to/80643 "2025-06-24T17:40:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RussBaz](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/russbaz/32/30841_2.png) [@RussBaz](https://forums.swift.org/u/RussBaz)\
**Post date:** [June 24, 2025, 5:40pm UTC](https://forums.swift.org/t/add-timestamps-to-vapor-logs-how-to/80643/1 "2025-06-24T17:40:46Z")

</div>

Hi. I would like to update the default Vapor logs format to include a timestamp. Can anyone point at how to do it?

Thanks!

---

<div class="post-metadata">

**Author:** ![0xTim](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/0xtim/32/27968_2.png) [@0xTim](https://forums.swift.org/u/0xTim)\
**Post date:** [June 24, 2025, 8:58pm UTC](https://forums.swift.org/t/add-timestamps-to-vapor-logs-how-to/80643/2 "2025-06-24T20:58:10Z")

</div>

When you bootstrap the logger, you want to use [this function](https://github.com/vapor/console-kit/blob/main/Sources/ConsoleKitTerminal/Utilities/ConsoleLogger.swift#L228) and then initialise the logger with the [timestamp fragment](https://github.com/vapor/console-kit/blob/main/Sources/ConsoleKitTerminal/Utilities/ConsoleLogger.swift#L12)

---

<div class="post-metadata">

**Author:** ![RussBaz](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/russbaz/32/30841_2.png) [@RussBaz](https://forums.swift.org/u/RussBaz)\
**Post date:** [June 25, 2025, 5:48am UTC](https://forums.swift.org/t/add-timestamps-to-vapor-logs-how-to/80643/3 "2025-06-25T05:48:43Z")

</div>

Awesome, thanks! I replaced the default one with the following snippet and it worked:

```swift
let level = try Logger.Level.detect(from: &env)
LoggingSystem.bootstrap(fragment: timestampDefaultLoggerFragment(), console: Terminal(), level: level)

```
