Skip to content

Instantly share code, notes, and snippets.

View matheusopedro's full-sized avatar

Matheus I. Pedro matheusopedro

View GitHub Profile
@matheusopedro
matheusopedro / Logger.js
Created February 28, 2019 17:00
Implementação simples do Simple Node Logger
'use strict';
const SimpleNodeLogger = require('simple-node-logger');
const loggerConstants = require('./logger.constants');
const opts = {
timestampFormat: loggerConstants.emptyFormat,
level: loggerConstants.logLevel
};
module.exports = SimpleNodeLogger.createSimpleLogger(opts);
@matheusopedro
matheusopedro / logger.js
Created February 28, 2019 16:59
Implementação do log estruturado
'use strict';
const SimpleNodeLogger = require('simple-node-logger');
const loggerConstants = require('./logger.constants');
const opts = {
timestampFormat: loggerConstants.emptyFormat,
level: loggerConstants.logLevel
};
const AbstractAppender = SimpleNodeLogger.AbstractAppender,
manager = new SimpleNodeLogger(opts);
@matheusopedro
matheusopedro / Log.json
Created February 28, 2019 16:58
Exemplo de Log da aplicação
{
"level": "info",
"message": "{\"acaoUsuario\":\"LOGIN\",\"sucesso\":true,\"versao\":\"1.2.3\"}",
"timestamp": "2019-01-07T16:50:30.799Z"
}
@matheusopedro
matheusopedro / kibanaDoc.json
Created February 28, 2019 16:57
Documento do kibana
{
"_index": "filebeat-6.5.4-2019.01.21",
"_type": "doc",
"_id": "AWhwgQCKtRO3GsqFILPl",
"_version": 1,
"_score": null,
"_source": {
"@timestamp": "2019-01-21T13:02:08.029Z",
"input": {
"type": "log"
@matheusopedro
matheusopedro / filbeat.yml
Created February 27, 2019 21:56
Configuração do filebeat para mapear objetos JSON em linhas de log
filebeat.inputs:
# Each - is an input. Most options can be set at the input level, so
# you can use different inputs for various configurations.
# Below are the input specific configurations.
- type: log
# Change to true to enable this input configuration.
enabled: true
@matheusopedro
matheusopedro / HashTable.c
Last active September 1, 2016 21:18
Trabalho de Compiladores e Montadores (Em andamento...)
/*
* Arquivo usado para teste do programa.
* Arquivo original:
* https://github.com/jelathro/C/blob/master/HashTable/HashTable.c
*
*
* @author: jelathro
* @date: 11/2/13
*
* Implementation file for HashTable.