All Projects → Tubitv → logger_sentry

Tubitv / logger_sentry

Licence: Apache-2.0 License
Elixir Logger backend for Sentry

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to logger sentry

monolog-sentry-handler
Monolog handler for Sentry PHP SDK v2 with breadcrumbs support
Stars: ✭ 34 (+70%)
Mutual labels:  sentry, logger
Quicklogger
Library for logging on files, console, memory, email, rest, eventlog, syslog, slack, telegram, redis, logstash, elasticsearch, influxdb, graylog, Sentry, Twilio, ide debug messages and throw events for Delphi/Firemonkey/freepascal/.NET (Windows/Linux/OSX/IOS/Android).
Stars: ✭ 137 (+585%)
Mutual labels:  sentry, logger
sentry-mobile
Sentry Mobile App
Stars: ✭ 31 (+55%)
Mutual labels:  sentry
nunit.testlogger
NUnit logger for vstest platform
Stars: ✭ 48 (+140%)
Mutual labels:  logger
horse-logger
Middleware for access logging in HORSE
Stars: ✭ 25 (+25%)
Mutual labels:  logger
sentry-spark
Apache Spark Sentry Integration
Stars: ✭ 14 (-30%)
Mutual labels:  sentry
auth0-instrumentation
The goal of this package is to make it easier to collect information about our services through logs, metrics and error catching.
Stars: ✭ 18 (-10%)
Mutual labels:  sentry
react-sendbird-messenger
ReactJS (React-router-dom v6 + Antdesign + Firebase + Sendbird + Sentry) codebase containing real world examples (CRUD, auth, advanced patterns, etc).
Stars: ✭ 39 (+95%)
Mutual labels:  sentry
winston-telegram
A Telegram transport for winston
Stars: ✭ 28 (+40%)
Mutual labels:  logger
sentry-k8s
Sentry for Kubernetes
Stars: ✭ 25 (+25%)
Mutual labels:  sentry
koa2-winston
koa2 version winston logger like express-winston
Stars: ✭ 37 (+85%)
Mutual labels:  logger
loggin-js
📝 Customizable and expandable logger for Node.js
Stars: ✭ 20 (+0%)
Mutual labels:  logger
dokku-sentry
Deploy your own instance of Sentry onto Dokku!
Stars: ✭ 64 (+220%)
Mutual labels:  sentry
tlf
TLF - a console based ham radio contest logger
Stars: ✭ 41 (+105%)
Mutual labels:  logger
printer
A fancy logger yet lightweight, and configurable. 🖨
Stars: ✭ 65 (+225%)
Mutual labels:  logger
boilerplate
Fullstack boilerplate using Typescript, React, Node & GraphQL
Stars: ✭ 738 (+3590%)
Mutual labels:  sentry
ip-logger
📇 When someone clicks the link, you will receive their IP and other information via telegram.
Stars: ✭ 0 (-100%)
Mutual labels:  logger
next-utils
🥩 🍳 A set of Next.js HoC utilities to make your life easier
Stars: ✭ 30 (+50%)
Mutual labels:  sentry
laravel-slow-query-logger
Slow Query Logger for Laravel 5.6
Stars: ✭ 27 (+35%)
Mutual labels:  logger
Readhub
Readhub AndroidClient
Stars: ✭ 40 (+100%)
Mutual labels:  logger

LoggerSentry

Build Status Module Version Hex Docs Total Download License Last Updated

The Logger backend for Sentry.

Installation

The package can be installed as:

Add :logger_sentry to your mix.exs file:

def deps do
  [
    {:logger_sentry, "~> 0.6.0"}
  ]
end

Configure your config file, just like:

config :logger,
  backends: [:console, Logger.Backends.Sentry],
  sentry: [
    level: :error,
    metadata: [:application, :module, :function, :file, :line, :pid] # :all
  ]

If you want keep :console backend in Logger event server, you should set :backends with [:console, Logger.Backends.Sentry]. Just like :console backend, the sentry backend supports the same :level and :metadata options.

Usage

Similar to Logger.

Logger.debug("this is one debug message")
Logger.info("this is one info message")
Logger.warn("this is one warning message")

# if you set sentry logger level with `:error`, the message will sent to your
# sentry server
Logger.error("this is one error message")

Get log level

Logger.Backends.Sentry.level

Set log level

Logger.Backends.Sentry.level(:error)

Get metadata

Logger.Backends.Sentry.metadata

Set metadata

Logger.Backends.Sentry.metadata([])
Logger.Backends.Sentry.metadata(:all)
Logger.Backends.Sentry.metadata([:application, :module, :pid])

Fingerprints

To use fingerprints in sentry dashboard, set :logger_sentry option to define generate fingerprints modules:

config :logger_sentry,
  fingerprints_mods: [
    LoggerSentry.Fingerprint.MatchMessage,
    LoggerSentry.Fingerprint.CodeLocation,
    MyApp.Fingerprint.MyModule
  ]

Only match error message, LoggerSentry.Fingerprint.MatchMessage and code location, LoggerSentry.Fingerprint.CodeLocation are available by default right now.

You can define your own module, for example, MyApp.Fingerprint.MyModule, by adding a fingerprints/2 function.

Examples

See additional usage examples at wiki.

Rate Limiting

Sentry can be configured with a rate limit on the Sentry servers. Any messages received faster than that limit will not be processed. In order to avoid unnecessary traffic and potentially getting IP-blocked by Sentry, it is recommended to add rate limiting on your own servers.

By default, LoggerSentry does not enforce rate limits. Rate limiting can be added through your project config files like this:

import Config

config :logger_sentry, LoggerSentry.RateLimiter,
    rate_limiter_module: LoggerSentry.RateLimiter.TokenBucket,
    rate_limiter_options: [token_count: 20, interval_ms: 60_000]

LoggerSentry comes with a simple token bucket algorithm. You may add other rate-limiting algorithms by creating a module that conforms to the LoggerSentry.RateLimiter module. Then setting rate_limiter_module to your custom module.

Copyright and License

Copyright (c) 2017 Taotao Lin

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].