---
title: "Deploy Monirail - Log Monitoring"
description: "Set up alerting for logs and metrics using a Railway function"
category: "Other"
url: https://railway.com/deploy/monirail-log-monitoring
---

# Deploy Monirail - Log Monitoring

Set up alerting for logs and metrics using a Railway function

**[Deploy Monirail - Log Monitoring on Railway](https://railway.com/template/monirail-log-monitoring)**

- **Creator:** Jared
- **Category:** Other
- **Total deploys:** 1

## Template content

### Monitoring https://raw.githubusercontent.com/jaredLunde/monirail/refs/heads/main/assets/monirail.svg

- **Image:** ghcr.io/railwayapp/function-bun:1.3.0
- **Start command:** `./run.sh aW1wb3J0IHsgbW9uaXRvciwgc291cmNlLCBub3RpZnksIHdhdGNoIH0gZnJvbSAibW9uaXJhaWxAMS4wLjEyIjsKCmNvbnN0IGRpc2NvcmROb3RpZmllciA9IG5vdGlmeSh7CiAgLy8gT3RoZXIgYXZhaWxhYmxlIG9wdGlvbnMgaW5jbHVkZSAic2xhY2siLCAicGFnZXJkdXR5IiwgIndlYmhvb2siLCBhbmQgImN1c3RvbSIKICB0eXBlOiAiZGlzY29yZCIsCiAgd2ViaG9va1VybDogQnVuLmVudi5ESVNDT1JEX1dFQkhPT0tfVVJMLAp9KTsKCi8vIENoZWNrIG1vbml0b3JzIGV2ZXJ5IDUgbWludXRlcwp3YXRjaCg1LCBbCiAgLy8gWW91IG1heSBhZGQgYXMgbWFueSBtb25pdG9ycyBpbiBoZXJlIGFzIHlvdSB3aXNoCiAgbW9uaXRvcih7CiAgICB0eXBlOiAibWF0Y2giLAogICAgbmFtZTogIkVycm9yIExvZ3MgQWxlcnQiLAogICAgZGVzY3JpcHRpb246ICJBbGVydHMgd2hlbiBlcnJvcnMgYXBwZWFyIGluIGxvZ3MiLAogICAgc291cmNlOiBzb3VyY2UoewogICAgICB0eXBlOiAiZW52aXJvbm1lbnRfbG9ncyIsCiAgICAgIGVudmlyb25tZW50SWQ6IEJ1bi5lbnYuUkFJTFdBWV9FTlZJUk9OTUVOVF9JRCEsCiAgICAgIHNlcnZpY2VJZDogQnVuLmVudi5TT1VSQ0VfU0VSVklDRV9JRCwKICAgIH0pLAogICAgZmlsdGVyOiBgQGxldmVsOmVycm9yYCwKICAgIHRpbWVXaW5kb3c6IDYwLCAvLyBJbiBtaW51dGVzCiAgICBub3RpZnk6IFtkaXNjb3JkTm90aWZpZXJdLAogIH0pLApdKTsK`

## Documentation

# Deploy and Host Monirail - Log Monitoring on Railway

Monitor Railway services and notify your team when issues are detected. This is hosted in a lightweight Railway function and is fully customizable by editing the source code.

[See Full Documentation](https://github.com/jaredLunde/monirail/blob/main/README.md)

## Quick Start

```typescript
import { monitor, source, notify, watch } from "monirail";

// Create a Slack notifier
const slack = notify({
	type: "slack",
	webhookUrl: process.env.SLACK_WEBHOOK_URL,
});

// Monitor for errors in your logs
const errorMonitor = monitor({
	name: "Error Alert",
	type: "match",
	source: source({ type: "environment_logs" }),
	filter: "@level:error",
	notify: [slack],
});

// Monitor CPU usage
const cpuMonitor = monitor({
	name: "High CPU",
	type: "threshold",
	source: source({
		type: "metrics",
		aggregate: "avg",
		measure: "CPU_USAGE",
	}),
	value: 80,
	notifyOn: "above",
	notify: [slack],
});

// Check monitors every minute
watch(1, [errorMonitor, cpuMonitor]);
```

## Common Use Cases

- Monitor a single service or the entire environment's logs
- Monitor a service's HTTP logs
- Monitor a service's metrics
- Send notifications to Discord, Slack, Pagerduty, Webhooks, or a custom provider (e.g. email)

## About Hosting
## Why Deploy
## Dependencies for
### Deployment Dependencies

## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — [Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/monirail-log-monitoring
