I want the different parts of my code to make annotations in my Solr logs so I know which parts of the code are generating which queries.
A log line currently looks like:
INFO: [collection1] webapp=/solr path=/select/ params={fq=dateFiled:[2007-01-01T00:00:00Z+TO+2007-12-31T00:00:00Z]&fq=status:Precedential&fq=westCite:"509+F.3d+173"} hits=0 status=0 QTime=2
I'd prefer if it said something like:
INFO: [collection1] webapp=/solr path=/select/ params={fq=dateFiled:[2007-01-01T00:00:00Z+TO+2007-12-31T00:00:00Z]&fq=status:Precedential&fq=westCite:"509+F.3d+173"} hits=0 status=0 QTime=2 Source=Scraper
INFO: [collection1] webapp=/solr path=/select/ params={fq=dateFiled:[2007-01-01T00:00:00Z+TO+2007-12-31T00:00:00Z]&fq=status:Precedential&fq=westCite:"509+F.3d+173"} hits=0 status=0 QTime=2 Source=user-query
Or something along those lines.
I suppose I could do this by using negation in the query, so every query has something like -source:scraper
. That shouldn't affect the query too much (guessing it'd be a negligible performance penalty since I lack a source
field), and it'd serve the purpose, but I'm hopeful there's a better way.