Skip to content

Logger

Not yet Class Platform & Data NotCreatable NotReplicated

A named logger that emits structured log entries scoped to a hierarchical path.

Not implemented yet

This class exists in the current Roblox API but is not implemented in Nova yet. Scripts that reference it will fail at runtime.

0 Nova members · 15 modern Roblox members not implemented yet

Description

A Logger emits structured log entries that are tagged with a hierarchical name, letting you group related messages by subsystem or feature. Obtain a top-level logger from LogService.GetLogger(), then create nested child loggers with Logger.GetLogger(). Each logger has a short Logger.Name and a dot-joined Logger.FullPath built from its ancestry (for example a logger named Damage created from a logger named Combat has the full path Combat.Damage).

local LogService = game:GetService("LogService")

local combat = LogService:GetLogger("Combat")
local damage = combat:GetLogger("Damage")

print(damage.Name)      --> Damage
print(damage.FullPath)  --> Combat.Damage

damage:Info("Dealt {amount} damage to {target}", {amount = 25, target = "Goblin"})

Loggers behave the same as the structured logging methods on LogService: messages flow to the Output window, the Developer Console, and LogService.MessageOut, and are included in LogService.GetLogHistory() tagged with the logger's full path.

Hierarchy and Propagation

When a message is logged on a logger, its Logger.MessageOut event fires on that logger and on every ancestor up to the root. This lets you attach a listener on a parent logger to observe all messages emitted by its descendants. The message is emitted to the engine's output system exactly once, tagged with the originating logger's full path.

Template Syntax and Context

The logging methods accept the same {key} template placeholders and context tables as the structured logging methods on LogService. See LogService for details on template syntax and how context values are stored.

Lifetime

A logger remains valid as long as you hold a reference to it. Once all references to a logger (and its descendants) are released, it is reclaimed, and calling any method on a stale logger raises an error. The number of live loggers and the length of a logger's full path are both bounded; exceeding either limit raises an error from Logger.GetLogger().

Warning

This class might have unexpected or unreliable behavior and content might be truncated. Don't rely on contents of events and messages emitted by loggers for any important game logic.

Inheritance

Object → Logger

Properties

Member Signature Summary
FullPath FullPath: string The dot-joined path of this logger from the root logger.
Name Name: string The name segment of this logger within its parent.

Methods

Member Signature Summary
Error Logger:Error(message: string, context: Dictionary = nil): null Logs a message at the MessageType.MessageError level with optional structured context.
GetLogger Logger:GetLogger(name: string): Logger Returns a child logger with the given name, creating it if it does not already exist.
Info Logger:Info(message: string, context: Dictionary = nil): null Logs a message at the MessageType.MessageInfo level with optional structured context.
Log Logger:Log(messageType: MessageType, message: string, context: Dictionary = nil): null Logs a message at the specified level with optional structured context.
Output Logger:Output(message: string, context: Dictionary = nil): null Logs a message at the MessageType.MessageOutput level with optional structured context.
Warn Logger:Warn(message: string, context: Dictionary = nil): null Logs a message at the MessageType.MessageWarning level with optional structured context.

Events

Member Signature Summary
MessageOut MessageOut(message: string, messageType: MessageType, context: Dictionary) Fires when a message is logged through this logger or any of its descendants.

Roblox reference: Logger

Generated from Nova's API dump and Roblox creator-docs. Nova-only members come from the engine's reflection metadata.