Skip to content

Commit

Permalink
ref(MISC): elimina api de log en desuso y reasigna nuevo loguer a lab…
Browse files Browse the repository at this point in the history
…oratorio (#1979)
  • Loading branch information
negro89 authored Oct 18, 2024
1 parent e379a45 commit 04f5ff7
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 174 deletions.
69 changes: 0 additions & 69 deletions core/log/routes/log.ts

This file was deleted.

67 changes: 0 additions & 67 deletions core/log/schemas/log.ts

This file was deleted.

11 changes: 11 additions & 0 deletions modules/rup/laboratorio.log.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Connections } from '../../connections';
import { Logger } from '@andes/log';

export const laboratorioLog = new Logger({
connection: Connections.logs,
module: 'laboratorio',
application: 'andes',
bucketBy: 'h',
bucketSize: 100,
expiredAt: '3 M'
});
17 changes: 13 additions & 4 deletions modules/rup/routes/protocolosLab.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as express from 'express';
import { services } from '../../../services';
import { Logger } from '../../../utils/logService';
import { laboratorioLog } from '../laboratorio.log';

const router = express.Router();

Expand All @@ -22,9 +22,18 @@ router.get('/protocolosLab/:id?', async (req, res, next) => {
throw new Error(response || service);
}
res.json(response);
} catch (e) {
await Logger.log(req, req.params.module, req.params.op, req.body.data);
res.json('error:' + e.message);
} catch (err) {
const data = {
id: req.params.id,
estado: req.query.estado,
documento: req.query.dni,
fechaNacimiento: req.query.fecNac,
apellido: req.query.apellido,
fechaDesde: req.query.fechaDde,
fechaHasta: req.query.fechaHta
};
await laboratorioLog.error('resultado-protocolo', data, err, req);
res.json('error:' + err.message);
}
});

Expand Down
3 changes: 2 additions & 1 deletion modules/webhook/logger/laboratorioCentralLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ export const laboratorioCentralLog = new Logger({
module: 'laboratorioCentral',
application: 'andes',
bucketBy: 'h',
bucketSize: 100
bucketSize: 100,
expiredAt: '3 M'
});
33 changes: 0 additions & 33 deletions utils/logService.ts

This file was deleted.

0 comments on commit 04f5ff7

Please sign in to comment.