Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CIT - Demanda rechazada (logs) #1979

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading