PHPackages                             greeny/nette-slack-logger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. greeny/nette-slack-logger

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

greeny/nette-slack-logger
=========================

Log your error messages directly into Slack room

1.2.0(10y ago)618.1k5[1 issues](https://github.com/greeny/nette-slack-logger/issues)[2 PRs](https://github.com/greeny/nette-slack-logger/pulls)MITPHP

Since Feb 12Pushed 6y ago4 watchersCompare

[ Source](https://github.com/greeny/nette-slack-logger)[ Packagist](https://packagist.org/packages/greeny/nette-slack-logger)[ RSS](/packages/greeny-nette-slack-logger/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

nette-slack-logger
==================

[](#nette-slack-logger)

Log your errors directly into Slack room

Installation
------------

[](#installation)

`composer require greeny/nette-slack-logger`

And register extension to your config.neon:

```
extensions:
	slackLogger: greeny\NetteSlackLogger\DI\SlackLoggerExtension
```

By default the logger is just turned off, since you probably do not want to log errors from dev environment. If you want to enable it, add following lines to config.local.neon at your production server:

```
slackLogger:
	enabled: true
	timeout: 60
	slackUrl: https://hooks.slack.com/services/XXX
	logUrl: http://path/to/your/logs/directory/__FILE__
```

Of course replace `slackUrl` with payload URL from your incomming webhook from Slack.

You can leave `logUrl` empty, but if you have your logs accessible through web (of course e.g. protected by HTTP auth or available only from company IPs), you can define this URL here. `__FILE__` will be replaced by filename of file with exception.

You can also define request timeout in key `timeout`.

### Configuration

[](#configuration)

You can also futher configure your logger:

```
slackLogger:
	messageFactory: Some\Message\Factory
	defaults:
		channel: XXX
		icon: XXX
		name: XXX
		title: XXX
		text: XXX
		color: XXX
```

`messageFactory` holds FQN of class, which is implementing `greeny\NetteSlackLogger\IMessageFactory`. This class is used for creating messages for Slack. You can omit it, if you want to use default provided one. If you create custom message factory, it receives default parameters as first argument and `logUrl` as second one.

Defaults are self-explaining, but here is description of them:

- `channel` - the channel you want your messages to arrive (overrides settings in webhook in slack administration)
- `icon` - the icon you want your bot to have (overrides settings in webhook in slack administration)
- `name` - the name you want your bot to have (overrides settings in webhook in slack administration)
- `title` - the title you want your message to have
- `text` - the text you want your message to have (you will probably never use this, but it is here for consistency purposes)
- `color` - the color you want your message to have (accepts `#RRGGBB` and maybe some other things, not sure about it)

### Handlers

[](#handlers)

You can also set custom handlers for logger. Just get your logger instance through DI or by calling `Tracy\Debugger::getLogger()` and use method `addHandler` to add your custom handler.

Handler is a callable, which receives `greeny\NetteSlackLogger\MessageSendEvent` as only argument. It has set of usefull methods:

- `getMessage()` - returns the message being sent
- `getValue()` - returns value being logged
- `getPriority()` - returns the priority of this log action
- `getLogFile()` - returns file to which value was logged (or NULL if nothing got logged)
- `cancel()` - cancels sending of message
- `isCancelled()` - returns if sending is cancelled or not

`getMessage()` method returns instance of `greeny\NetteSlackLogger\IMessage`, which has getters and setters for same properties, which you define in `defaults` section (see Configuration)

You can alter your message here, since handlers are called before message is sent. If you cancel message, it still gets logged into that file.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 90% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~15 days

Total

4

Last Release

3744d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3734204?v=4)[Tomáš Blatný](/maintainers/greeny)[@greeny](https://github.com/greeny)

---

Top Contributors

[![greeny](https://avatars.githubusercontent.com/u/3734204?v=4)](https://github.com/greeny "greeny (9 commits)")[![vysinsky](https://avatars.githubusercontent.com/u/3693578?v=4)](https://github.com/vysinsky "vysinsky (1 commits)")

---

Tags

netteslacklogger

### Embed Badge

![Health badge](/badges/greeny-nette-slack-logger/health.svg)

```
[![Health](https://phpackages.com/badges/greeny-nette-slack-logger/health.svg)](https://phpackages.com/packages/greeny-nette-slack-logger)
```

###  Alternatives

[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14844.4k1](/packages/guanguans-laravel-exception-notify)[kdyby/monolog

Integration of Monolog into Nette Framework

32700.0k10](/packages/kdyby-monolog)[contributte/newrelic

NewRelic PHP agent integration for Nette Framework

19829.4k](/packages/contributte-newrelic)[nextras/tracy-monolog-adapter

Nextras Tracy-Monolog Adapter

1129.1k](/packages/nextras-tracy-monolog-adapter)[vojtasvoboda/oc-errorlogger-plugin

Sends an error from your OctoberCMS application directly to email, HipChat, Slack, NewRelic and more.

153.3k](/packages/vojtasvoboda-oc-errorlogger-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
