telefonicaid / fiware-orion

Context Broker and CEF building block for context data management, providing NGSI interfaces.
https://fiware-orion.rtfd.io/
GNU Affero General Public License v3.0
211 stars 265 forks source link

Add srv=, subsrv=, from= fields in traces #1593

Closed fgalan closed 8 years ago

fgalan commented 8 years ago

Include the following fields in log traces, as per request from Operations.

fgalan commented 8 years ago

This is the format that will be implementeed (ok with Operations):


time=2015-12-03T12:30:15.363CET | lvl=INFO | trans=1449141927-158-00000000003 | srv=pending | subsrv=pending | from=pending | function=LM_TRANSACTION_START | comp=Orion | msg=logMsg.h[1798]: Starting transaction from 192.168.206.1:58275/v1/contextEntities
time=2015-12-03T12:30:15.370CET | lvl=INFO | trans=1449141927-158-00000000003 | srv=valencia | subsrv=/Basuras | from=192.168.206.1 | function=collectionRangedQuery | comp=Orion | msg=connectionOperations.cpp[151]: Database Operation Successful (query: { query: { $or: [ { _id.id: /.*/ } ], _id.servicePath: { $in: [ /^/Basuras$/ ] } }, orderby: { creDate: 1 } })
time=2015-12-03T12:30:15.370CET | lvl=INFO | trans=1449141927-158-00000000003 | srv=valencia | subsrv=/Basuras | from=192.168.206.1 | function=collectionRangedQuery | comp=Orion | msg=connectionOperations.cpp[151]: Database Operation Successful (query: { query: { $or: [ { contextRegistration.entities.id: /.*/ }, { contextRegistration.entities: { $in: [] } }, { contextRegistration.entities.id: { $in: [] } } ], expiration: { $gt: 1449142215 }, servicePath: { $in: [ /^/Basuras$/ ] } }, orderby: { _id: 1 } })
time=2015-12-03T12:30:15.371CET | lvl=INFO | trans=1449141927-158-00000000003 | srv=valencia | subsrv=/Basuras | from=192.168.206.1 | function=collectionRangedQuery | comp=Orion | msg=connectionOperations.cpp[151]: Database Operation Successful (query: { query: { $or: [ { contextRegistration.entities.id: /.*/ }, { contextRegistration.entities: { $in: [] } }, { contextRegistration.entities.id: { $in: [] } } ], expiration: { $gt: 1449142215 }, servicePath: { $in: [ /^/Basuras$/ ] } }, orderby: { _id: 1 } })
time=2015-12-03T12:30:15.371CET | lvl=INFO | trans=1449141927-158-00000000003 | srv=valencia | subsrv=/Basuras | from=192.168.206.1 | function=LM_TRANSACTION_END | comp=Orion | msg=logMsg.h[1885]: Transaction ended

time=2015-12-03T12:31:48.728CET | lvl=INFO | trans=1449141927-158-00000000004 | srv=pending | subsrv=pending | from=pending | function=LM_TRANSACTION_START | comp=Orion | msg=logMsg.h[1798]: Starting transaction from 192.168.206.1:58275/v1/contextEntities
time=2015-12-03T12:31:48.729CET | lvl=INFO | trans=1449141927-158-00000000004 | srv=valencia | subsrv=/Basuras | from=8.80.8.80 | function=collectionRangedQuery | comp=Orion | msg=connectionOperations.cpp[151]: Database Operation Successful (query: { query: { $or: [ { _id.id: /.*/ } ], _id.servicePath: { $in: [ /^/Basuras$/ ] } }, orderby: { creDate: 1 } })
time=2015-12-03T12:31:48.730CET | lvl=INFO | trans=1449141927-158-00000000004 | srv=valencia | subsrv=/Basuras | from=8.80.8.80 | function=collectionRangedQuery | comp=Orion | msg=connectionOperations.cpp[151]: Database Operation Successful (query: { query: { $or: [ { contextRegistration.entities.id: /.*/ }, { contextRegistration.entities: { $in: [] } }, { contextRegistration.entities.id: { $in: [] } } ], expiration: { $gt: 1449142308 }, servicePath: { $in: [ /^/Basuras$/ ] } }, orderby: { _id: 1 } })
time=2015-12-03T12:31:48.731CET | lvl=INFO | trans=1449141927-158-00000000004 | srv=valencia | subsrv=/Basuras | from=8.80.8.80 | function=collectionRangedQuery | comp=Orion | msg=connectionOperations.cpp[151]: Database Operation Successful (query: { query: { $or: [ { contextRegistration.entities.id: /.*/ }, { contextRegistration.entities: { $in: [] } }, { contextRegistration.entities.id: { $in: [] } } ], expiration: { $gt: 1449142308 }, servicePath: { $in: [ /^/Basuras$/ ] } }, orderby: { _id: 1 } })
time=2015-12-03T12:31:48.732CET | lvl=INFO | trans=1449141927-158-00000000004 | srv=valencia | subsrv=/Basuras | from=8.80.8.80 | function=LM_TRANSACTION_END | comp=Orion | msg=logMsg.h[1885]: Transaction ended
fgalan commented 8 years ago

Implemented in PR #1596

fgalan commented 8 years ago

QA Acceptance Test pending. Reopened and asigned to QATestPending milestone.

iariasleon commented 8 years ago

pending tests in alarm folder

iariasleon commented 8 years ago

Pull Request with acceptance tests: https://github.com/telefonicaid/fiware-orion/pull/1927

iariasleon commented 8 years ago

LGTM