Question|Feature: Multi-Tag Writer
See original GitHub issueThe following scenario occurs:
- Library 1: Logs to TAG “Lib1”
- Library 2: Logs to TAG “Lib2”
- Main program includes the libs (but cannot change them) and logs to TAG “Main”
- All tags shall appear in the the same log (typically a file, but could be something else)
So the question is (or an idea if the feature does not exists yet) is:
Can a writer support multiple tags.
writer.tag = Lib1|Lib2|Main
writer.tag = Lib1,Lib2,Main
On writer creation the writer would then just need to be written so several positions on the matrix[TAG][LEVEL] like the levels already do. I am not sure whether this is already possible as the matrix supports this feature but it seems for each entry a new writer object is created and I could not find any other way on how to set the multiple tags on the writer. That approach would be a very small change to ConfigurationParser
.
Possible other approaches to the problem are (but none is fully convincing)
- SharedFileWriter (but this is an overkill with locking and seems to not work inside one thread in one program?)
- Static writers like the Console writer (so a static File Writer with a static FileStream) do work
- Having a “Forwarding” Writer does in principlly work (it forwards the log to another tag. But has a bit problems with the required log entries if they differ as you need to know about the required log entries before all writers exists).
- Use an user defined writer (extend FileWriteR) which gets all TAGs and filter for the TAGS of interest.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Filtering questions by multiple tags - Meta Stack Exchange
But is there a way to view questions only for a certain set of tags > 1 tag? Mainly I'd like the union...
Read more >Adding multiple tags in one feature file - Stack Overflow
I have one feature file with different scenarios. Is it a good idea to add multiple tags for each feature file? Feature: Login....
Read more >Finding Questions in the Question Bank - Online Exam Software
There are a total of 8 questions whose category tag value is “writing”. There are a total of 5 questions whose level tag...
Read more >Question Types - Qualtrics
Multiple Choice: Multiple choice questions form the basis of most research. They can be displayed as a traditional list of choices or as...
Read more >Mark Up FAQs with Structured Data | Google Search Central
When you use FAQ structured data, you may help users discover information in a rich result. Learn about FAQ schema markup and see...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think it is a nice enhancement in function and configuration possibility for very little effort and risk. Your architecture of the tags and levels basically asks for such a feature 😃
After your hint this morning, I implemented for my use case the “catchall” function storing the necessary tags as a “user field”. The loggers work now as expected but it requires extending or copying all used writers. Which is no problem but not a very elegant solution. So I would revert that and use the multi-tag feature instead.
This closed issue has been locked automatically. However, please feel free to file a new issue.