3.6.101 • Published 10 months ago

@erboladaiorg/reiciendis-inventore v3.6.101

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Introduction

A logger that logs to Grafana Loki.

Installation

yarn add @erboladaiorg/reiciendis-inventore

Usage

Importing module

import { LokiLoggerModule } from '@erboladaiorg/reiciendis-inventore';
@Module({
  imports: [
    LokiLoggerModule.forRoot({
      app: 'app-name',
      host: 'host',
      userId: 'user id',
      password: 'password',
      environment: 'development' | 'production', // Optional, defaults to production
      logDev: false, // Optional, default to false
      minLogLevel: LogLevel.verbose, // Optional, defaults to LogLevel.verbose
    }),
  ],
  providers: [],
  exports: [],
})
export class AModule {}

Importing module Async

import { LokiLoggerModule } from '@erboladaiorg/reiciendis-inventore';
@Module({
  imports: [
    LokiLoggerModule.forRootAsync({
      useFactory: async () => {
        return {
          app: 'app-name',
          host: 'host',
          userId: 'user id',
          password: 'password',
          environment: 'development' | 'production', // Optional, defaults to production
          logDev: false, // Optional, default to false
          minLogLevel: LogLevel.verbose, // Optional, defaults to LogLevel.verbose
        };
      },
    }),
  ],
  providers: [],
  exports: [],
})
export class AModule {}

Use logger for nest logging

import { NestFactory } from '@nestjs/core';
import { MainModule } from './main.module';
import { LokiLoggerService } from '@erboladaiorg/reiciendis-inventore';


async function bootstrap() {
  const app = await NestFactory.create(MainModule, {
    bufferLogs: true,
  });
  app.useLogger(app.get(LokiLoggerService));
  await app.listen(3000, '0.0.0.0');
}
bootstrap();

Use request logging interceptor

import { LokiLoggerModule, LokiRequestLoggingInterceptor } from '@erboladaiorg/reiciendis-inventore';
@Module({
  imports: [
    LokiLoggerModule.forRootAsync({
      useFactory: async () => {
        return {
          app: 'app-name',
          host: 'host',
          userId: 'user id',
          password: 'password',
          environment: 'development' | 'production', // Optional, defaults to production
          logDev: false, // Optional, default to false
          minLogLevel: LogLevel.verbose, // Optional, defaults to LogLevel.verbose
        };
      },
    }),
  ],
  providers: [LokiRequestLoggerInterceptorProvider],
  exports: [],
})
export class AModule {}

Use the log service

import { LokiLoggerService } from '@erboladaiorg/reiciendis-inventore';

@Injectable()
export class AService {
  constructor(private readonly loggerService: LokiLoggerService) {
    this.loggerService.verbose('message', [{ optionalProps: 'optionalProps' }])
  }
}

Author

André Ekbom Github

License

Licensed under the MIT License - see the LICENSE file for details.

formsintrinsicgetPrototypeOfiteratorArray.prototype.flatmoduleterminalutil.inspectqueryietextxhrrmmergermdircallbindtoolsvalueECMAScript 2019optimizerslotdeep-copyReactiveXcolumnsrdsstylinginspectsubprocesstakeespreeconsumearraysweakmaptoArraysuperagentexecfiledatavisualrouteawesomesauceTypeBoxjQueryparentES3full-widthArrayBuffer#slicecurriedbyteLengthmaplengthwarningbddhardlinksargumenttypanionprefixstylesESnextclonenopetoobjecttransportcoerciblemkdirsdateagentgesturesECMAScript 2015gdprvaluesprototypees-shimsutilitiesES8metadatacheckUint8ClampedArraylistenersfunctionshellpostcss-pluginutilityECMAScript 2022jsxsymlinksspinnersfeedajaxfigletmonorepotypeofnumberchai__proto__es8typesenvironmentObservableprunersscopyclass-validatorreadableArray.prototype.findLastpathcallbackefficientchromiuml10nkeysenumerabledeepclonees2018envjsdiffshamvarsuuidreadablestreamecmascriptsqstrimEndsortio-tsvalidnamesregularextratypedarrayshtmlbrowserslisteast-asian-widthframeworkES2023installerFunction.prototype.nameWebSocketmake dirbinariesinstrumentationforEachcachewaapifunctionsfunction.lengthhookscode pointsURLrequestregexpes2017traversemochaqueueMicrotaskprivatelruasciiIteratores2016styleguideflag[[Prototype]]constspinnerECMAScript 2021resolveeventEmitterfile systemInt16ArraycallstringifyshebangfnmatchformatforktypesafegetintrinsichasOwnconcatObject.assignconfigurableassertstoReverseddragfixed-widthWebSocketsregular expressionfullcolourbrowseres5streamsmkdirimportreadtransformremoveglobalsreactcall-boundstyleArrayES5glacierjsonschemai18nroute53typeerrorwritesetterECMAScript 7ArrayBuffer.prototype.sliceerrordayjsvaridvpccharactersfantasy-landeventDispatcherlookkeyminimalappUint32ArrayarraybufferspeedrouterJSON-Schemapropertieseslintconfigsyntaxerrorform-validationserializetouchweaksetidentifiersclientexpresscoreloadbalancingdescriptionlogreal-timeiaminferenceStreamselectronlanguagedependency managerequalrestfulRxdom-testing-libraryprotobufpyyamleslintgroupstreamsearchtimeamazonredactprogresstranspilerpoint-freeWeakMapdynamodbdebuggeryuploadinghttpcryptotacitwaitquoteECMAScript 6Float32Arrayspringastparserreact-testing-libraryshrinkwrapisConcatSpreadableStreampackage.jsonhasvariablesqstestersortedcollectionchineseincludesfilesource mapisjshintairbnbTypedArrayhelperrm -frStyleSheeta11ycloudwatchcloudtrail_.extendcompilermkdirptrimLeftrulescommand-linebindsnsdiffwindowpicomatchargsjasminegetteracornuser-streamsFloat64ArrayfastcopypushkinesissafeesfullwidthSetECMAScript 2018prettyemitjapanesecloudformationexpressionUnderscorees-abstractttyObservablesflagssharedarraybufferobjzodmomentzxpropertyschemalockfilebeanstalktypescriptdomapienvironmentstypedarrayworkspace:*utilsrandomfilterReflect.getPrototypeOfReactiveExtensionsvalidatorwidthjsdomfpcomputed-typesArray.prototype.flattennodejsimmernativecall-bindpopmotionboundclassesmapreduceECMAScript 2023queuecircularclassnameES7fpsassertionproxycommandtoSortedswflastidlematchprotocol-buffersasyncrfc4122gitignoreeventstddparseautoscalingquerystringtc39omitescapeinstallconfigdataviewcomparePushsameValueZeroCSSStyleDeclarationlocalsetes-shim APItrim6to5argvpatchcurltermphonereact-hook-formpluginwgetstableserializerawssomefastcloneexecObjectArrayBufferzerofindLastIndex.envpinoglobalThisstringAsyncIteratorstyled-componentsobjectwalkingentriesfast-deep-copybundlinganimationautoprefixerchannelfolderRegExp.prototype.flagsshared@@toStringTagcharacterpackagescss-in-jsloggingInt8ArraynpmignoreviewdependenciesvesttypedtypecolumnoutputdeepcopyframerschemeMicrosoftglobal this valueignoreselfObject.isindicatorformresthigher-orderjsonRFC-6455endpointdeep-clonemakeyamlurl256buffersparentsECMAScript 5purepackage managersetPrototypeOfuptspipeasterisksrgbRxJSwhatwginwalktrimStartworkflowObject.fromEntriesguidreducerconcatMapreduxECMAScript3dramdafromArray.prototype.flatMaparrayreact animationvalidatesetImmediatecssMapjsistanbulECMAScript 3getinvariantECMAScript 2016-0eslintplugindescriptorsformattingsyntaxObject.keysartinternal slotpnpm9nameequalityavasuperstructSymbol.toStringTagprivate datanodebabelcreatesettingsoncecliredux-toolkitfsletpropECMAScript 2020hookformUint8ArrayYAMLSystem.globaldataViewregular-expressiongenericselbtapgroupByperformanceArray.prototype.filterUint16ArrayslicetostringtagchildlinkObject.valuespreprocessoreffect-tsURLSearchParamsxtermglobString.prototype.trimJSONfindup0matchesECMAScript 2017ES6extend
3.6.101

10 months ago

3.6.100

10 months ago

3.6.99

10 months ago

3.6.98

10 months ago

3.6.97

10 months ago

3.6.96

10 months ago

3.6.95

10 months ago

3.6.94

11 months ago

3.6.93

11 months ago

3.6.92

11 months ago

3.5.92

11 months ago

3.5.91

11 months ago

3.5.90

11 months ago

3.4.90

11 months ago

3.4.89

11 months ago

3.4.88

11 months ago

3.4.87

11 months ago

3.4.86

11 months ago

3.4.85

11 months ago

3.4.84

11 months ago

3.4.83

11 months ago

3.4.82

11 months ago

3.4.81

11 months ago

3.4.80

11 months ago

3.4.79

11 months ago

3.4.78

11 months ago

3.4.77

11 months ago

3.4.76

11 months ago

3.4.75

11 months ago

3.4.74

11 months ago

3.4.73

11 months ago

3.4.72

11 months ago

3.4.71

11 months ago

3.4.70

11 months ago

3.4.69

11 months ago

3.4.68

11 months ago

3.4.67

11 months ago

3.4.66

12 months ago

3.3.66

12 months ago

3.3.65

12 months ago

3.3.64

12 months ago

3.3.63

12 months ago

3.3.62

12 months ago

3.3.61

12 months ago

3.3.60

12 months ago

3.3.59

12 months ago

3.3.58

12 months ago

3.3.57

12 months ago

3.3.56

12 months ago

3.3.55

12 months ago

3.3.54

12 months ago

3.3.53

12 months ago

3.3.52

12 months ago

3.3.51

12 months ago

3.3.50

12 months ago

3.3.49

12 months ago

3.3.48

12 months ago

3.3.47

1 year ago

3.3.46

1 year ago

3.3.45

1 year ago

3.3.44

1 year ago

3.3.43

1 year ago

3.3.42

1 year ago

3.3.41

1 year ago

3.3.40

1 year ago

3.3.39

1 year ago

3.3.38

1 year ago

3.3.37

1 year ago

3.3.36

1 year ago

3.3.35

1 year ago

3.2.35

1 year ago

3.2.34

1 year ago

3.2.33

1 year ago

3.2.32

1 year ago

3.2.31

1 year ago

3.2.30

1 year ago

3.2.29

1 year ago

3.2.28

1 year ago

3.2.27

1 year ago

3.2.26

1 year ago

3.2.25

1 year ago

3.2.24

1 year ago

3.2.23

1 year ago

3.2.22

1 year ago

3.2.21

1 year ago

3.2.20

1 year ago

3.2.19

1 year ago

3.2.18

1 year ago

3.2.17

1 year ago

3.2.16

1 year ago

3.2.15

1 year ago

2.2.15

1 year ago

1.2.15

1 year ago

1.2.14

1 year ago

1.2.13

1 year ago

1.2.12

1 year ago

1.2.11

1 year ago

1.2.10

1 year ago

1.2.9

1 year ago

1.2.8

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago