1
1
import { Status , StatusMessage } from '@navikt/appstatus-react-ds' ;
2
2
import { ReactElement } from 'react' ;
3
3
import { IntlProvider } from 'react-intl' ;
4
+ import { configureLogger } from '@navikt/next-logger' ;
4
5
import { InnsynPsbApp } from '@navikt/sif-app-register' ;
5
6
import { AmplitudeProvider } from '@navikt/sif-common-amplitude' ;
6
7
import { storageParser } from '@navikt/sif-common-core-ds/src/utils/persistence/storageParser' ;
@@ -13,20 +14,31 @@ import ErrorBoundary from '../components/error-boundary/ErrorBoundary';
13
14
import HentInnsynsdataFeilet from '../components/hent-innsynsdata-feilet/HentInnsynsdataFeilet' ;
14
15
import EmptyPage from '../components/page-layout/empty-page/EmptyPage' ;
15
16
import { InnsynsdataContextProvider } from '../context/InnsynsdataContextProvider' ;
17
+ import { getFaro , initInstrumentation , pinoLevelToFaroLevel } from '../faro/faro' ;
18
+ import { messages } from '../i18n' ;
16
19
import { Innsynsdata } from '../types/InnsynData' ;
17
20
import appSentryLogger from '../utils/appSentryLogger' ;
18
21
import { browserEnv } from '../utils/env' ;
19
22
import UnavailablePage from './unavailable.page' ;
20
23
import 'react-loading-skeleton/dist/skeleton.css' ;
21
24
import '../components/process/process.css' ;
22
25
import '../style/global.css' ;
23
- import { messages } from '../i18n' ;
24
26
25
- export const APPLICATION_KEY = 'sif-innsyn' ;
27
+ export const AMPLITUDE_APPLICATION_KEY = 'sif-innsyn' ;
26
28
27
29
const innsynsdataFetcher = async ( url : string ) : Promise < Innsynsdata > =>
28
30
axios . get ( url , { transformResponse : storageParser } ) . then ( ( res ) => res . data ) ;
29
31
32
+ initInstrumentation ( ) ;
33
+
34
+ configureLogger ( {
35
+ basePath : process . env . NEXT_PUBLIC_BASE_PATH ,
36
+ onLog : ( log ) =>
37
+ getFaro ( ) . api . pushLog ( log . messages , {
38
+ level : pinoLevelToFaroLevel ( log . level . label ) ,
39
+ } ) ,
40
+ } ) ;
41
+
30
42
function MyApp ( { Component, pageProps } : AppProps ) : ReactElement {
31
43
const { data, error, isLoading } = useSWR < Innsynsdata , AxiosError > (
32
44
`${ browserEnv . NEXT_PUBLIC_BASE_PATH } /api/innsynsdata` ,
0 commit comments