This question already has an answer here:
- Magento 2: Replacement for Mage::log method? 13 answers
How I can create my own custom log file in magento2 ?
For example, I have some variable which wants to log in a custom file. I found a solution for only existing log file like system.log, debug.log but I want new custom log file to log my variable.