Dancer2...er::File(3)

πŸ’– Dancer2::Logger::File β€” the file-based logging engine for Dancer2 πŸŽ€

okay bestie, so this is a page from the User Contributed Perl Documentation collection, and it's literally all about Dancer2::Logger::File, the logging engine that lets your Dancer2 app dump its logs into actual files on disk. yes queen, files. on disk. slay. ✨


🌸 VERSION 🌸

version 2.2.1 β€” periodt, that's the one we're working with. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

This is a logging engine that allows you to save your logs to files on disk. it's giving "i want receipts of everything my app did" and honestly? iconic.

⚠️ okay so listen β€” logs are not automatically rotated. no cap. if you let them pile up they will just keep growing forever like my to-do list 😭. the move is to use a log rotation tool like logrotate in copytruncate mode. that's the vibe. don't skip this part fr fr.

✨ METHODS ✨

πŸ’œ log($level, $message)

Writes the log message to the file. that's it, that's the whole method, and she ate. 🫢


πŸ‘‘ CONFIGURATION πŸ‘‘

so to actually use this logging engine in your Dancer2 app, the setting logger needs to be set to File. that's the unlock, iykyk πŸ”“

the following attributes are supported:

  • log_dir β€” the directory path that holds your log files. defaults to logs in the application directory. like, it just goes and chills in logs unless you tell it otherwise πŸ“
  • file_name β€” the name of the log file. defaults to the environment name with a .log suffix. cute, consistent, we love her πŸ’–

here's an example configuration that uses this logger and stores logs in /var/log/myapp β€” look at her go:

logger: "File"

engines:
  logger:
    File:
      log_dir: "/var/log/myapp"
      file_name: "myapp.log"

main character configuration honestly 🌈


🌟 AUTHOR 🌟

Dancer Core Developers β€” the collective legends. πŸ‘‘


This software is copyright (c) 2026 by Alexis Sukrieh.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so like, go forth and remix, bestie πŸ’…


and that's the whole page!! this was perl v5.42.3 energy, dated 2026-09-20, and you can find her filed under Dancer2::Logger::File(3) in the User Contributed Perl Documentation. mwah, go log something gorgeous πŸ¦‹πŸ’–

πŸ“¦ where this page comes from