LogEntry Model

The LogEntry model represents an individual log event in LogFlowAI. It stores the timestamp, log level, message, service, host, and additional metadata as JSON.

class logapp.models.LogEntry(*args, **kwargs)

LogEntry model representing a log event with various details such as timestamp, level, message, service, host, and additional data. This class stores log events produced by various services and allows for the inclusion of extra structured data.

Parameters:
  • id (int) -- A unique identifier for the log entry (primary key).

  • timestamp (datetime, optional) -- The datetime when the log was recorded.

  • level (str, optional) -- The severity level of the log event (e.g., INFO, WARN, ERROR).

  • message (str, optional) -- The log message providing details about the event.

  • service (str, optional) -- The service or component that produced the log.

  • host (str, optional) -- The hostname or IP address of the machine where the log originated.

  • additional_data (dict, optional) -- Any additional structured data stored as JSON.

__str__()

Returns a string representation of the log entry in the format: [timestamp] level: message.

exception DoesNotExist
exception MultipleObjectsReturned