3.6.101 • Published 1 year ago

@erboladaiorg/reiciendis-inventore v3.6.101

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

3.6.100

1 year ago

3.6.99

1 year ago

3.6.98

1 year ago

3.6.97

1 year ago

3.6.96

1 year ago

3.6.95

1 year ago

3.6.94

1 year ago

3.6.93

1 year ago

3.6.92

1 year ago

3.5.92

1 year ago

3.5.91

1 year ago

3.5.90

1 year ago

3.4.90

1 year ago

3.4.89

1 year ago

3.4.88

1 year ago

3.4.87

1 year ago

3.4.86

1 year ago

3.4.85

1 year ago

3.4.84

1 year ago

3.4.83

1 year ago

3.4.82

1 year ago

3.4.81

1 year ago

3.4.80

1 year ago

3.4.79

1 year ago

3.4.78

1 year ago

3.4.77

1 year ago

3.4.76

1 year ago

3.4.75

1 year ago

3.4.74

1 year ago

3.4.73

1 year ago

3.4.72

1 year ago

3.4.71

1 year ago

3.4.70

1 year ago

3.4.69

1 year ago

3.4.68

1 year ago

3.4.67

1 year ago

3.4.66

1 year ago

3.3.66

1 year ago

3.3.65

1 year ago

3.3.64

1 year ago

3.3.63

1 year ago

3.3.62

1 year ago

3.3.61

1 year ago

3.3.60

1 year ago

3.3.59

1 year ago

3.3.58

1 year ago

3.3.57

1 year ago

3.3.56

1 year ago

3.3.55

1 year ago

3.3.54

1 year ago

3.3.53

1 year ago

3.3.52

1 year ago

3.3.51

1 year ago

3.3.50

1 year ago

3.3.49

1 year ago

3.3.48

1 year 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