Numerous Philanthropic Misanthropes

    react-logging-error-boundary

    1.0.10 • Public • Published

    react-logging-error-boundary

    npm package

    An error boundary component which sends your logs to Sentry and Loggly.

    Edit LoggingErrorBoundary

    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

    Install

    npm i react-logging-error-boundary

    DownloadsWeekly Downloads

    12

    Version

    1.0.10

    License

    MIT

    Unpacked Size

    101 kB

    Total Files

    8

    Last publish

    Collaborators

    • bilgeonceken