diff --git a/README.md b/README.md index 20515e39..654fb6a5 100644 --- a/README.md +++ b/README.md @@ -332,7 +332,7 @@ We structure our logs according to these [NYPL standards](https://github.com/NYP Do NOT use `console.log` if you want to add a permanent log, and make sure to clean up your debugging `console.log`s, because they will clutter Cloudwatch and New Relic. On the server side, DO use `logger.[some NYPL log level](message: string)`. -On the client side, DO use `newrelic.log(message: string, {level: 'debug|error|info|trace|warn'})` OR `newrelic.error(message: string)` (New Relic log levels only partially correspond to NYPL log levels). +On the client side... ## Github Actions diff --git a/app/divisions/page.tsx b/app/divisions/page.tsx index bdda5a2c..9b8cf052 100644 --- a/app/divisions/page.tsx +++ b/app/divisions/page.tsx @@ -17,6 +17,13 @@ export default async function Divisions() { if (data?.headers?.code === "404") { redirect("/404"); } + + if ((window as any).newrelic) { + (window as any).newrelic.log("test log from divisions server component", { + level: "error", + }); + } + return ( diff --git a/app/src/components/pages/divisionsPage/divisionsPage.tsx b/app/src/components/pages/divisionsPage/divisionsPage.tsx index 0320f938..f6a14784 100644 --- a/app/src/components/pages/divisionsPage/divisionsPage.tsx +++ b/app/src/components/pages/divisionsPage/divisionsPage.tsx @@ -22,11 +22,6 @@ export default function DivisionsPage({ summary, divisions }: DivisionsProps) { useEffect(() => { setIsLoaded(true); - if ((window as any).newrelic) { - (window as any).newrelic.log("test log from divisions page", { - level: "error", - }); - } }, []); return ( { // Send error to New Relic if ((window as any).newrelic) { - (window as any).newrelic.log("Test error", { level: "warn" }); + (window as any).newrelic.log("Test error for New Relic", { + level: "warn", + }); } throw new Error("Test error"); }, []);