Skip to main content
Dev · 283 tools

Mock Error Log Generator

Generates realistic application error log lines for testing log parsers and monitoring tools

Generated Log LinesExample — click Generate for yours
  • 2026-11-28T06:07:15.695Z [INFO] [order-processor] trace_id=2d884a217b9fd9aa - Received shutdown signal — draining connections
  • 2026-11-28T05:59:46.349Z [ERROR] [email-relay] trace_id=135982c750be69b4 - DatabaseWriteFailure: Transaction rolled back due to constraint violation
  • 2026-11-28T06:35:58.792Z [INFO] [user-service] trace_id=4cd7be99dc2592cf - Cache warmed from snapshot
  • 2026-11-28T06:29:08.050Z [INFO] [payment-service] trace_id=d5d6080579c3fb1d - Health check passed
  • 2026-11-28T06:14:04.847Z [INFO] [report-engine] trace_id=4f62d17b3029f6a1 - Received shutdown signal — draining connections
  • 2026-11-28T06:15:24.204Z [DEBUG] [email-relay] trace_id=7b375a9a7f921f3a - Cache miss for key session:abc — resolving upstream
  • 2026-11-28T06:16:10.178Z [INFO] [payment-service] trace_id=13edbd43e47d0e8a - Scheduled job completed in 4.2s
  • 2026-11-28T06:12:57.609Z [INFO] [email-relay] trace_id=ede2910c1cde1c97 - Received shutdown signal — draining connections
  • 2026-11-28T06:29:53.709Z [ERROR] [notification-svc] trace_id=8abf209b67559ce6 - UpstreamServiceError: Downstream service returned 503 after retries exhausted
  • 2026-11-28T06:10:43.119Z [INFO] [email-relay] trace_id=b0ad99fdc6c659bf - Cache warmed from snapshot

Generated 10 items

See 3 examples
  • Example 1
    2026-11-28T06:07:15.695Z [INFO] [order-processor] trace_id=2d884a217b9fd9aa - Received shutdown signal — draining connections
    2026-11-28T05:59:46.349Z [ERROR] [email-relay] trace_id=135982c750be69b4 - DatabaseWriteFailure: Transaction rolled back due to constraint violation
    2026-11-28T06:35:58.792Z [INFO] [user-service] trace_id=4cd7be99dc2592cf - Cache warmed from snapshot
    2026-11-28T06:29:08.050Z [INFO] [payment-service] trace_id=d5d6080579c3fb1d - Health check passed
    2026-11-28T06:14:04.847Z [INFO] [report-engine] trace_id=4f62d17b3029f6a1 - Received shutdown signal — draining connections
    2026-11-28T06:15:24.204Z [DEBUG] [email-relay] trace_id=7b375a9a7f921f3a - Cache miss for key session:abc — resolving upstream
    2026-11-28T06:16:10.178Z [INFO] [payment-service] trace_id=13edbd43e47d0e8a - Scheduled job completed in 4.2s
    2026-11-28T06:12:57.609Z [INFO] [email-relay] trace_id=ede2910c1cde1c97 - Received shutdown signal — draining connections
    2026-11-28T06:29:53.709Z [ERROR] [notification-svc] trace_id=8abf209b67559ce6 - UpstreamServiceError: Downstream service returned 503 after retries exhausted
    2026-11-28T06:10:43.119Z [INFO] [email-relay] trace_id=b0ad99fdc6c659bf - Cache warmed from snapshot
  • Example 2
    2026-11-28T06:43:12.118Z [INFO] [search-index] trace_id=a86293a2bdb745ce - Configuration reloaded from source
    2026-11-28T06:21:29.523Z [DEBUG] [auth-service] trace_id=8dd75be29946f91e - Acquired lock for resource orders:42
    2026-11-28T06:21:44.448Z [INFO] [payment-service] trace_id=6639fd01f3a549f0 - Successfully processed batch
    2026-11-28T06:42:57.125Z [WARN] [order-processor] trace_id=6286ade217c710ec - Rate limit approaching threshold for API key
    2026-11-28T06:53:05.085Z [ERROR] [inventory-svc] trace_id=fead7b7759bbfcc0 - AuthenticationFailure: Invalid credentials for user session
    2026-11-28T06:50:31.323Z [WARN] [report-engine] trace_id=8d25cd1162cef390 - Circuit breaker opened for downstream call
    2026-11-28T06:46:54.075Z [ERROR] [inventory-svc] trace_id=c275963bda8b8612 - ConnectionTimeoutError: Failed to connect to database after 3 retries
    2026-11-28T06:00:12.753Z [INFO] [report-engine] trace_id=70a25603990c19fb - Successfully processed batch
    2026-11-28T06:07:47.420Z [DEBUG] [user-service] trace_id=2e96f351257528a3 - Entering handler with payload size 214 bytes
    2026-11-28T06:45:19.897Z [DEBUG] [email-relay] trace_id=bb6ab970775a05ca - Entering handler with payload size 214 bytes
  • Example 3
    2026-11-28T06:13:29.308Z [ERROR] [search-index] trace_id=34fd3e5a11926614 - DatabaseWriteFailure: Transaction rolled back due to constraint violation
    2026-11-28T06:50:43.553Z [DEBUG] [notification-svc] trace_id=b2c5ebec9577320a - Retry scheduler idle
    2026-11-28T06:32:34.537Z [ERROR] [payment-service] trace_id=9231dc04406a6e85 - UpstreamServiceError: Downstream service returned 503 after retries exhausted
    2026-11-28T06:03:37.401Z [INFO] [email-relay] trace_id=cfc10f04fba77cd9 - Successfully processed batch
    2026-11-28T06:38:12.273Z [INFO] [payment-service] trace_id=501793f972ce6b59 - Successfully processed batch
    2026-11-28T06:54:36.749Z [WARN] [inventory-svc] trace_id=5991e0a0a9b6ebb0 - Request timeout exceeded 5000ms
    2026-11-28T06:14:10.205Z [ERROR] [auth-service] trace_id=51fad80713498024 - UpstreamServiceError: Downstream service returned 503 after retries exhausted
    2026-11-28T06:14:14.661Z [DEBUG] [user-service] trace_id=bbc9d2faaf8659a4 - Entering handler with payload size 214 bytes
    2026-11-28T06:32:30.810Z [INFO] [inventory-svc] trace_id=538c0f7dcc11fc71 - User session established
    2026-11-28T06:37:42.209Z [DEBUG] [search-index] trace_id=8708742389e32d17 - Cache miss for key session:abc — resolving upstream

About this generator

Every logging pipeline — Logstash, Fluentd, Filebeat, Splunk, Elastic — needs test input before you can validate grok patterns, field extractions, and alert thresholds. Tapping production logs for test data raises privacy concerns and makes tests non-deterministic. The mock error log generator produces structured, realistic log lines on demand. Each line follows a consistent format: ISO 8601 timestamp, bracketed log level, bracketed service name, a trace_id key-value pair, and a human-readable message. Service names rotate through auth-service, api-gateway, user-service, payment-service, notification-svc, and cache-layer. The level selector defaults to mixed, which includes all four levels in roughly equal distribution. Pin it to ERROR or WARN to send a consistent severity stream for threshold and suppression testing. Generate up to 50 lines per batch.

How to use

  1. Set the 'Number of log lines' field to how many entries you need — 10 for a quick test, 100+ for pipeline stress-testing.
  2. Choose a log level from the selector: pick 'mixed' for a realistic severity distribution or a single level to target specific parser branches.
  3. Click Generate to produce the log output, then review a few lines to confirm the format matches your parser's expectations.
  4. Copy the output and paste it directly into your test file, log shipper input, or parser unit test fixture.
  5. If you need a larger dataset, click Generate multiple times and concatenate the outputs into a single file.

Use Cases

  • •Writing a grok pattern in Logstash and validating field extraction against 50 mixed-level sample lines
  • •Bootstrapping a Kibana index with DEBUG and ERROR entries before any real application is deployed
  • •Pinning the level to ERROR and replaying the batch to tune PagerDuty alert thresholds without spamming on-call
  • •Building pytest fixtures for a Python log-parsing library that extracts and groups lines by traceId
  • •Running a live team demo where colleagues triage a simulated spike of WARN and ERROR log entries

Tips

  • →To test a grok pattern in Logstash, generate 20 lines at 'mixed' level and run them through the Grok Debugger before wiring up a full pipeline.
  • →Pin the level to FATAL and generate 50 lines to verify your alerting rule fires correctly without the threshold being diluted by lower-severity events.
  • →Concatenate several generated batches in a text file and tail it with Filebeat to simulate a live, streaming log source during dashboard development.
  • →If your real logs include a specific service name, manually find-replace the generated service names to match — this makes Kibana field filters behave identically to production.
  • →Generate a 'mixed' batch and count the level distribution manually; if your monitoring tool expects specific ratios, adjust by combining single-level batches in the proportions you need.
  • →Use generated WARN logs specifically to test alert suppression rules — WARN should notify but not page, and mock data lets you fire that path safely in staging.

FAQ

how do I generate fake log lines for testing a logstash or fluentd pipeline

Set count to 20–50 and leave level on mixed so your pipeline sees every severity in one batch. Copy the output into a .log file and point a Filebeat file input or Fluentd tail plugin at it. The fixed structure — ISO timestamp, bracketed level, service name, trace_id key-value — parses cleanly with a standard grok pattern.

what format do the generated log lines follow

Each line follows this structure: ISO 8601 timestamp, bracketed log level, bracketed service name, a trace_id key-value pair, and a human-readable message. For example: 2024-03-15T10:23:41.882Z [ERROR] [auth-service] trace_id=a3f9c2... Failed to connect to database after 3 retries. This mirrors conventions from winston, Logback, and structlog.

can I use these generated logs to test splunk queries or elastic detection rules

Yes. Paste the lines into a Splunk event input and write SPL queries against level, service, and trace_id immediately — no custom field extractions required. For Elastic, ingest via Filebeat and validate Kibana alert thresholds or detection rules. Pin the level selector to ERROR to fire the same condition repeatedly without INFO noise.

does the mixed level option produce all four log levels in equal proportions

The level is chosen at random from an equal-weight pool of ERROR, WARN, INFO, and DEBUG, so the distribution across a batch is roughly equal. Real logs typically have many more INFO entries than ERRORs. If you want a realistic production ratio, generate separate batches pinned to each level and concatenate them in the proportions matching your actual application.

You might also like

Popular tools from other categories that share themes with this one.