Okay so I've read the answer here How do I set the log levels for force:apex:log:tail? as well I have read all the documentation I can find for the sfdx force:apex:log:tail command. And everything I have read says that if I specify the --debuglevel flag and give it the name of a valid DebugLevel in my target org the trace flag in the target org should be setup using the DebugLevel that I provided in the command.
Now the results that I keep getting is that the trace flag in the target org is always setup with the default SFDC_DevConsole DebugLevel regardless of what I specify the --debuglevel flag in the command to be. I am also seeing the same behavior when the target org is a production, sandbox or scratch org. I have updated my sfdx cli multiple times since I've seen this issue and am still seeing it on the current version I just updated to: sfdx-cli/7.15.3-c7d407d236 win32-x64 node-v10.15.3
So my question is there anyone else seeing this behavior? and or does anyone have an explanation why this may be happening?
UPDATE:
After some further testing with the latest update to the sfdx-cli I have found the following:
When I run the following command I successfully setup a DebugLevel named CLI
sfdx force:data:record:create -u dev -s DebugLevel -t -v "DeveloperName=CLI MasterLabel=CLI ApexCode=FINEST ApexProfiling=NONE Callout=NONE Database=INFO System=NONE Validation=NONE Visualforce=FINEST Workflow=NONE Wave=NONE Nba=NONE"
Then I run the following command to setup a trace flag using the CLI DebugLevel
sfdx force:apex:log:tail -u dev --debuglevel CLI
On the first run of the previous command where I have no trace flags active for my user it seems the --debuglevel CLI is ignored and the trace flag is setup with the DebugLevel SFDC_DevConsole.
Now with the SFDC_DevConsole trace flag active if I run the following command again it updates the existing trace flag to use the CLI DebugLevel as expected.
sfdx force:apex:log:tail -u dev --debuglevel CLI
So it seems that the cli won't create a trace flag with the specified DebugLevel but will only update an existing trace flag to the correct DebugLevel which I can only assume is a bug with the cli.