react-logging-error-boundary
v1.0.10
Published
react-logging-error-boundary React component
Downloads
35
Maintainers
Readme
react-logging-error-boundary
An error boundary component which sends your logs to Sentry and Loggly.
Usage
import React from "react"
import ReactDOM from "react-dom"
import LoggingErrorBoundary from "react-logging-error-boundary"
import GivesError from "./GivesError"
import { ErrorPage } from "./ErrorPage"
function App() {
return (
<div className="App">
<LoggingErrorBoundary
logService={{
sentry: {
dsn: "your sentry dsn"
},
loggly: { logglyKey: "your loggly key" }
}}
errorComponent={<ErrorPage />}
>
<GivesError />
</LoggingErrorBoundary>
</div>
)
}
ReactDOM.render(<App />, document.getElementById("root"))
Properties
| Property | Type | Required | Description |
| :--------------- | :-------- | :------- | :------------------------------------------------------------ |
| logService
| object | no | object that contains your sentry and/or loggly configs |
| errorComponent
| component | yes | If something is broken users will see this instead of red box |