Repository: avocado-framework/avocado

Issue:
Excessive output at the LOG_UI
Hi all,

I am not sure what changed while I was away but our custom CI with the most current (master branch) Avocado backend now prints excessive output like so:
```
[root@c60]# avocado run /bin/true
JOB ID     : 67f7de083bf3cbeed3df313d2da7f484c8c5da6a
JOB LOG    : /mnt/local/results/job-2021-07-22T20.58-67f7de0/job.log
INFO:avocado.sysinfo:Commands configured by file: /etc/avocado/sysinfo/commands
avocado.sysinfo: Commands configured by file: /etc/avocado/sysinfo/commands
INFO:avocado.sysinfo:Files configured by file: /etc/avocado/sysinfo/files
avocado.sysinfo: Files configured by file: /etc/avocado/sysinfo/files
DEBUG:avocado.sysinfo:File /usr/lib/python3.9/site-packages/avocado/etc/avocado/sysinfo/fail_commands does not exist.
avocado.sysinfo: File /usr/lib/python3.9/site-packages/avocado/etc/avocado/sysinfo/fail_commands does not exist.
DEBUG:avocado.sysinfo:File /usr/lib/python3.9/site-packages/avocado/etc/avocado/sysinfo/fail_files does not exist.
avocado.sysinfo: File /usr/lib/python3.9/site-packages/avocado/etc/avocado/sysinfo/fail_files does not exist.
INFO:avocado.sysinfo:Profilers configured by file: /etc/avocado/sysinfo/profilers
avocado.sysinfo: Profilers configured by file: /etc/avocado/sysinfo/profilers
INFO:avocado.sysinfo:Profiler disabled
avocado.sysinfo: Profiler disabled
DEBUG:avocado.sysinfo:Not logging /proc/pci (file does not exist)
avocado.sysinfo: Not logging /proc/pci (file does not exist)
DEBUG:avocado.sysinfo:Not logging /sys/kernel/debug/sched_features (file does not exist)
avocado.sysinfo: Not logging /sys/kernel/debug/sched_features (file does not exist)
avocado.test: Command line: /usr/bin/avocado run /bin/true
avocado.test: 
avocado.test: Avocado version: 89.0
avocado.test: 
avocado.test: Avocado config:
avocado.test: 
avocado.test: {'assets.fetch.ignore_errors': False,
avocado.test:  'assets.fetch.references': [],
avocado.test:  'assets.list.days': None,
avocado.test:  'assets.list.overall_limit': None,
avocado.test:  'assets.list.size_filter': None,
avocado.test:  'assets.purge.days': None,
avocado.test:  'assets.purge.overall_limit': None,
avocado.test:  'assets.purge.size_filter': None,
avocado.test:  'assets.register.name': None,
avocado.test:  'assets.register.sha1_hash': None,
avocado.test:  'assets.register.url': None,
avocado.test:  'config': None,
avocado.test:  'config.datadir': False,
avocado.test:  'core.input_encoding': 'utf-8',
avocado.test:  'core.paginator': False,
avocado.test:  'core.show': {'app', 'early', 'debug'},
avocado.test:  'core.verbose': False,
avocado.test:  'datadir.paths.base_dir': '/root/avocado',
avocado.test:  'datadir.paths.cache_dirs': ['/root/avocado/data/cache'],
avocado.test:  'datadir.paths.data_dir': '/root/avocado/data',
avocado.test:  'datadir.paths.logs_dir': '/mnt/local/results',
avocado.test:  'datadir.paths.test_dir': '/usr/share/doc/avocado/tests',
avocado.test:  'diff.create_reports': False,
avocado.test:  'diff.filter': ['cmdline', 'time', 'variants', 'results', 'config', 'sysinfo'],
avocado.test:  'diff.html': None,
avocado.test:  'diff.jobids': [],
avocado.test:  'diff.open_browser': False,
avocado.test:  'diff.strip_id': False,
avocado.test:  'distro.distro_def_arch': '',
avocado.test:  'distro.distro_def_create': False,
avocado.test:  'distro.distro_def_name': '',
avocado.test:  'distro.distro_def_path': '',
avocado.test:  'distro.distro_def_release': '',
avocado.test:  'distro.distro_def_type': '',
avocado.test:  'distro.distro_def_version': '',
avocado.test:  'filter.by_tags.include_empty': False,
avocado.test:  'filter.by_tags.include_empty_key': False,
avocado.test:  'filter.by_tags.tags': [],
avocado.test:  'i2n.common.suite_path': '/mnt/local/intra2net-qa/tp_i2n',
avocado.test:  'i2n.manu.params': [],
avocado.test:  'job.output.loglevel': 'DEBUG',
avocado.test:  'job.output.testlogs.logfiles': ['debug.log'],
avocado.test:  'job.output.testlogs.statuses': [],
avocado.test:  'job.replay.source_job_id': 'latest',
avocado.test:  'job.run.result.html.enabled': True,
avocado.test:  'job.run.result.html.open_browser': False,
avocado.test:  'job.run.result.html.output': None,
avocado.test:  'job.run.result.json.enabled': True,
avocado.test:  'job.run.result.json.output': None,
avocado.test:  'job.run.result.tap.enabled': True,
avocado.test:  'job.run.result.tap.include_logs': False,
avocado.test:  'job.run.result.tap.output': None,
avocado.test:  'job.run.result.xunit.enabled': True,
avocado.test:  'job.run.result.xunit.job_name': None,
avocado.test:  'job.run.result.xunit.max_test_log_chars': 100000,
avocado.test:  'job.run.result.xunit.output': None,
avocado.test:  'job.run.store_logging_stream': [],
avocado.test:  'job.run.timeout': 0,
avocado.test:  'jobs.get.output_files.destination': None,
avocado.test:  'jobs.get.output_files.job_id': None,
avocado.test:  'jobs.show.job_id': 'latest',
avocado.test:  'json.variants.load': None,
avocado.test:  'list.auto': False,
avocado.test:  'list.external_runner': None,
avocado.test:  'list.external_runner_chdir': None,
avocado.test:  'list.external_runner_testdir': None,
avocado.test:  'list.loaders': ['file', '@DEFAULT'],
avocado.test:  'list.recipes.write_to_directory': None,
avocado.test:  'list.references': [],
avocado.test:  'list.resolver': False,
avocado.test:  'list.write_to_json_file': None,
avocado.test:  'nrunner.max_parallel_tasks': 48,
avocado.test:  'nrunner.shuffle': False,
avocado.test:  'nrunner.spawner': 'process',
avocado.test:  'nrunner.status_server_buffer_size': 33554432,
avocado.test:  'nrunner.status_server_listen': '127.0.0.1:8888',
avocado.test:  'nrunner.status_server_uri': '127.0.0.1:8888',
avocado.test:  'plugins.cli.cmd.order': [],
avocado.test:  'plugins.cli.order': [],
avocado.test:  'plugins.disable': [],
avocado.test:  'plugins.init.order': [],
avocado.test:  'plugins.job.prepost.order': [],
avocado.test:  'plugins.jobscripts.post': '/etc/avocado/scripts/job/post.d/',
avocado.test:  'plugins.jobscripts.pre': '/etc/avocado/scripts/job/pre.d/',
avocado.test:  'plugins.jobscripts.warn_non_existing_dir': False,
avocado.test:  'plugins.jobscripts.warn_non_zero_status': True,
avocado.test:  'plugins.resolver.order': [],
avocado.test:  'plugins.result.order': [],
avocado.test:  'plugins.result_events.order': [],
avocado.test:  'plugins.result_upload.cmd': None,
avocado.test:  'plugins.result_upload.url': None,
avocado.test:  'plugins.resultsdb.api_url': None,
avocado.test:  'plugins.resultsdb.logs_url': None,
avocado.test:  'plugins.resultsdb.note_size_limit': 0,
avocado.test:  'plugins.runnable.runner.order': [],
avocado.test:  'plugins.runner.order': [],
avocado.test:  'plugins.skip_broken_plugin_notification': [],
avocado.test:  'plugins.spawner.order': [],
avocado.test:  'plugins.varianter.order': [],
avocado.test:  'plugins.vtjoblock.dir': '/tmp',
avocado.test:  'run.auto': False,
avocado.test:  'run.dict_variants': [],
avocado.test:  'run.dry_run.enabled': False,
avocado.test:  'run.dry_run.no_cleanup': False,
avocado.test:  'run.execution_order': 'variants-per-test',
avocado.test:  'run.external_runner': None,
avocado.test:  'run.external_runner_chdir': None,
avocado.test:  'run.external_runner_testdir': None,
avocado.test:  'run.failfast': False,
avocado.test:  'run.ignore_missing_references': False,
avocado.test:  'run.job_category': None,
avocado.test:  'run.journal.enabled': True,
avocado.test:  'run.keep_tmp': False,
avocado.test:  'run.loaders': ['file', '@DEFAULT'],
avocado.test:  'run.log_test_data_directories': False,
avocado.test:  'run.output_check': True,
avocado.test:  'run.output_check_record': None,
avocado.test:  'run.references': ['/bin/true'],
avocado.test:  'run.replay.ignore': [],
avocado.test:  'run.replay.job_id': None,
avocado.test:  'run.replay.resume': False,
avocado.test:  'run.replay.test_status': [],
avocado.test:  'run.results.archive': False,
avocado.test:  'run.results_dir': None,
avocado.test:  'run.test_parameters': [],
avocado.test:  'run.test_runner': 'runner',
avocado.test:  'run.unique_job_id': None,
avocado.test:  'run.wrapper.wrappers': [],
avocado.test:  'runner.exectest.exitcodes.skip': [],
avocado.test:  'runner.output.color': 'always',
avocado.test:  'runner.output.colored': True,
avocado.test:  'runner.output.utf8': True,
avocado.test:  'runner.timeout.after_interrupted': 60,
avocado.test:  'runner.timeout.process_alive': 60,
avocado.test:  'runner.timeout.process_died': 10,
avocado.test:  'simpletests.status.failure_fields': ['status', 'stdout', 'stderr'],
avocado.test:  'simpletests.status.skip_location': 'all',
avocado.test:  'simpletests.status.skip_regex': '^SKIP$',
avocado.test:  'simpletests.status.warn_location': 'all',
avocado.test:  'simpletests.status.warn_regex': '^WARN$',
avocado.test:  'spawner.podman.bin': '/usr/bin/podman',
avocado.test:  'spawner.podman.image': 'fedora:31',
avocado.test:  'subcommand': 'run',
avocado.test:  'sysinfo.collect.commands_timeout': -1,
avocado.test:  'sysinfo.collect.enabled': True,
avocado.test:  'sysinfo.collect.installed_packages': False,
avocado.test:  'sysinfo.collect.locale': 'C',
avocado.test:  'sysinfo.collect.optimize': False,
avocado.test:  'sysinfo.collect.per_test': False,
avocado.test:  'sysinfo.collect.profiler': False,
avocado.test:  'sysinfo.collect.sysinfodir': None,
avocado.test:  'sysinfo.collectibles.commands': '/etc/avocado/sysinfo/commands',
avocado.test:  'sysinfo.collectibles.fail_commands': '/usr/lib/python3.9/site-packages/avocado/etc/avocado/sysinfo/fail_commands',
avocado.test:  'sysinfo.collectibles.fail_files': '/usr/lib/python3.9/site-packages/avocado/etc/avocado/sysinfo/fail_files',
avocado.test:  'sysinfo.collectibles.files': '/etc/avocado/sysinfo/files',
avocado.test:  'sysinfo.collectibles.profilers': '/etc/avocado/sysinfo/profilers',
avocado.test:  'task.timeout.running': None,
avocado.test:  'variants.contents': False,
avocado.test:  'variants.debug': False,
avocado.test:  'variants.inherit': False,
avocado.test:  'variants.json_variants_dump': None,
avocado.test:  'variants.summary': 0,
avocado.test:  'variants.tree': False,
avocado.test:  'variants.variants': 1,
avocado.test:  'vmimage.get.arch': None,
avocado.test:  'vmimage.get.distro': None,
avocado.test:  'vmimage.get.version': None,
avocado.test:  'vt.common.arch': None,
avocado.test:  'vt.common.data_dir': '',
avocado.test:  'vt.common.machine_type': 'i440fx',
avocado.test:  'vt.common.mem': None,
avocado.test:  'vt.common.netdst': 'virbr0',
avocado.test:  'vt.common.nettype': '',
avocado.test:  'vt.common.tmp_dir': '/tmp',
avocado.test:  'vt.common.type_specific_only': False,
avocado.test:  'vt.config': None,
avocado.test:  'vt.debug.no_cleanup': False,
avocado.test:  'vt.extra_params': [],
avocado.test:  'vt.filter.default_filters': None,
avocado.test:  'vt.guest_os': 'JeOS.27',
avocado.test:  'vt.libvirt.connect_uri': None,
avocado.test:  'vt.list_archs': False,
avocado.test:  'vt.list_guests': False,
avocado.test:  'vt.list_guests.guest_os': None,
avocado.test:  'vt.no_filter': '',
avocado.test:  'vt.only_filter': '',
avocado.test:  'vt.qemu.accel': 'kvm',
avocado.test:  'vt.qemu.defconfig': 'yes',
avocado.test:  'vt.qemu.disk_bus': 'virtio_blk',
avocado.test:  'vt.qemu.image_type': 'qcow2',
avocado.test:  'vt.qemu.malloc_perturb': 'yes',
avocado.test:  'vt.qemu.monitor': '',
avocado.test:  'vt.qemu.nic_model': 'virtio_net',
avocado.test:  'vt.qemu.qemu_bin': None,
avocado.test:  'vt.qemu.qemu_dst_bin': '/bin/qemu-kvm',
avocado.test:  'vt.qemu.sandbox': 'on',
avocado.test:  'vt.qemu.smp': '2',
avocado.test:  'vt.qemu.vhost': 'off',
avocado.test:  'vt.save_config': None,
avocado.test:  'vt.setup.backup_image_before_test': True,
avocado.test:  'vt.setup.keep_guest_running': False,
avocado.test:  'vt.setup.restore_image_after_test': True,
avocado.test:  'vt.short_names_when_config': False,
avocado.test:  'vt.type': 'qemu'}
avocado.test: 
avocado.test: Avocado Data Directories:
avocado.test: 
avocado.test: base     /root/avocado
avocado.test: tests    /root/avocado/tests
avocado.test: data     /root/avocado/data
avocado.test: logs     /mnt/local/results/job-2021-07-22T20.58-67f7de0
avocado.test: 
avocado.test: Temporary dir: /var/tmp/avocado_l9epimp5/avocado_job_tfyvvywg
avocado.test: 
avocado.test: Job ID: 67f7de083bf3cbeed3df313d2da7f484c8c5da6a
avocado.test: 
avocado.test: INIT 1-/bin/true
avocado.test: PARAMS (key=timeout, path=*, default=None) => None
avocado.test: Test metadata:
avocado.test:   filename: /bin/true
avocado.test:   teststmpdir: /var/tmp/avocado_bhes34o9
avocado.test:   workdir: /mnt/local/results/job-2021-07-22T20.58-67f7de0/test-results/tmp_dir4ctis0zu/1-_bin_true
 (1/1) /bin/true:  avocado.test: START 1-/bin/true
avocado.test: DATA (filename=output.expected) => NOT FOUND (data sources: variant, file)
avocado.test: Running '/bin/true'
avocado.test: Command '/bin/true' finished with 0 after 0.0010310580000805203s
avocado.test: Detailed information about the executed command:
avocado.test:   Exit status: 0
avocado.test:   Duration: 0.0010310580000805203
avocado.test:   STDOUT: 
avocado.test:   STDERR: 
avocado.test: DATA (filename=output.expected) => NOT FOUND (data sources: variant, file)
avocado.test: DATA (filename=stdout.expected) => NOT FOUND (data sources: variant, file)
avocado.test: DATA (filename=stderr.expected) => NOT FOUND (data sources: variant, file)
avocado.test: PASS 1-/bin/true
avocado.test: 
PASS (0.02 s)
avocado.test: Test results available in /mnt/local/results/job-2021-07-22T20.58-67f7de0
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
DEBUG:avocado.sysinfo:Not logging /proc/pci (file does not exist)
avocado.sysinfo: Not logging /proc/pci (file does not exist)
DEBUG:avocado.sysinfo:Not logging /sys/kernel/debug/sched_features (file does not exist)
avocado.sysinfo: Not logging /sys/kernel/debug/sched_features (file does not exist)
JOB HTML   : /mnt/local/results/job-2021-07-22T20.58-67f7de0/results.html
JOB TIME   : 0.80 s
```

I would expect most of these lines to be sent only to the logs. Is there some recent change in behavior I have missed or is this truly unexpected behavior?



Discussion:
Maybe this: https://github.com/avocado-framework/avocado/pull/4787

Do you have a configuration file setting the log level?
Locally, using the master, I don't have the output you added here:

```
$ avocado run /bin/true
JOB ID     : 6c864cad7a7061303bc9e94daa70dae95fe5f1ff
JOB LOG    : /home/wrampazz/avocado/job-results/job-2021-07-22T16.20-6c864ca/job.log
 (1/1) /bin/true: PASS (0.02 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /home/wrampazz/avocado/job-results/job-2021-07-22T16.20-6c864ca/results.html
JOB TIME   : 0.75 s
```
Setting log to `all` produces the same output as you showed:

```
avocado --show all run /bin/true
```

This makes me think you have something setting the log level.
> Maybe this: #4787
> 
> Do you have a configuration file setting the log level?

Indeed, reverting this change fixed it. Hmmmm...

> Setting log to `all` produces the same output as you showed:
> 
> ```
> avocado --show all run /bin/true
> ```
> 
> This makes me think you have something setting the log level.

The entire `avocado config` output is included in the logs above so I guess we could spot any responsible configuration. The thing is thought that I haven't changed any previously used setting for these runs, it is a standard run that used to work before with the same settings and doesn't work now, reverting the above changes seems to solve it though so I suspect it could be some conflict between the two.
> > Maybe this: #4787
> > Do you have a configuration file setting the log level?
> 
> Indeed, reverting this change fixed it. Hmmmm...
> 
> > Setting log to `all` produces the same output as you showed:
> > ```
> > avocado --show all run /bin/true
> > ```
> > 
> > 
> >     
> >       
> >     
> > 
> >       
> >     
> > 
> >     
> >   
> > This makes me think you have something setting the log level.
> 
> The entire `avocado config` output is included in the logs above so I guess we could spot any responsible configuration. The thing is thought that I haven't changed any previously used setting for these runs, it is a standard run that used to work before with the same settings and doesn't work now, reverting the above changes seems to solve it though so I suspect it could be some conflict between the two.

I see the config shows `avocado.test:  'core.show': {'app', 'early', 'debug'},`

and that gives me the same output as yours when I use:

`avocado --show app,early,debug run /bin/true`

As that mentioned pull request fixed a bug, that is the reason you never saw this output before.
I see, since I was getting the extra output I tweaked the
```
export AVOCADO_LOG_DEBUG=1
export AVOCADO_LOG_EARLY=1
```

on and off to see if this was a changed default so that would explain the above output and I apologize if it wasn't fully sanitized in advance. The problem though is that with a new session now these variables are no longer set and I experience the same (which initially made me adjust them above):
```
[root@c60]# avocado config | grep show
    core.show                                {'app'}
    jobs.show.job_id                         latest
[root@c60]# avocado run /bin/true
JOB ID     : d6985cc36244b0304547b05cd4b7d0b5f7be8624
JOB LOG    : /mnt/local/results/job-2021-07-22T21.47-d6985cc/job.log
INFO:avocado.sysinfo:Commands configured by file: /etc/avocado/sysinfo/commands
INFO:avocado.sysinfo:Files configured by file: /etc/avocado/sysinfo/files
DEBUG:avocado.sysinfo:File /usr/lib/python3.9/site-packages/avocado/etc/avocado/sysinfo/fail_commands does not exist.
DEBUG:avocado.sysinfo:File /usr/lib/python3.9/site-packages/avocado/etc/avocado/sysinfo/fail_files does not exist.
INFO:avocado.sysinfo:Profilers configured by file: /etc/avocado/sysinfo/profilers
INFO:avocado.sysinfo:Profiler disabled
DEBUG:avocado.sysinfo:Not logging /sys/kernel/debug/sched_features (file does not exist)
DEBUG:avocado.sysinfo:Not logging /proc/pci (file does not exist)
 (1/1) /bin/true: PASS (0.02 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
DEBUG:avocado.sysinfo:Not logging /sys/kernel/debug/sched_features (file does not exist)
DEBUG:avocado.sysinfo:Not logging /proc/pci (file does not exist)
JOB HTML   : /mnt/local/results/job-2021-07-22T21.47-d6985cc/results.html
JOB TIME   : 0.87 s
```
As you can see I still see unexpected debug output. Could it be that the above PR fixes another previously broken logging setting?

I do have
```
[root@c60 intra2net-qa]# avocado config | grep loglevel
    job.output.loglevel                      DEBUG
```
which could potentially explain the situation above but I never set this value, could it be the current avocado default? This is all the customization I use:
```
[root@c60]# cat /etc/avocado/avocado.conf 
[datadir.paths]
# You may override the specific job results directory with logs_dir
logs_dir = /mnt/local/results

[runner.output]
# Whether to display colored output in terminals that support it
colored = True
# Whether to force colored output to non-tty outputs (e.g. log files)
# Allowed values: auto, always, never
color = always

[run.journal]
# Whether to use results journal
enabled = True
```
> I do have
> 
> ```
> [root@c60 intra2net-qa]# avocado config | grep loglevel
>     job.output.loglevel                      DEBUG
> ```
> 

I also have it set to DEBUG and I don´t have those outputs.

Interesting thing is that those outputs are all related to sysinfo.
So, your current result looks like the same as reported here: https://github.com/avocado-framework/avocado/issues/4758
Indeed, there seem to be some overlap. I saw the issue too before posting this one but it seemed to have some reinstall and additional reported problems that I don't experience which is why I decided it is probably not the same cause. Thanks for linking the issues though, for now I will monitor for comments there and eventually close this one if the root cause turns to be the same.

For everyone's information, now I can fix the situation in our CI with a minimal diff like
```diff
def disable_log_handler(logger):
+    #if not logger:
+    #    return
-    if not logger:
-        return
    if isinstance(logger, str):
        logger = logging.getLogger(logger)
    # Handlers might be reused elsewhere, can't delete them
    while logger.handlers:
        logger.handlers.pop()
    logger.handlers.append(logging.NullHandler())
    logger.propagate = False
```
Ok, maybe we need to assume that  the root logger here is always `avocado.`.
Hi @pevogam , let me explain a little better:

Those 2 lines are there to make sure we are not disabling the root log state.

Here I'm having the same result as @willianrampazzo, and I cant reproduce. So seems to be some custom settings or something else.  As @willianrampazzo mention it seems  to be related to sysinfo. Maybe do you have any custom sysinfo commands/profilers  (/etc/avocado/sysinfo/*)?

Can you please also double check if you have any other config file in place? (avocado config | head  -20) 

For sure, we still need some adjustment but would be nice to have a reproducer.
@pevogam we definitely need to get down to the cause of the issue you are seeing.  If we can not isolate to Avocado, we need to look into other aspects, so it would make sense to look into the environment you are using.  Could you please share:

* If you have plugins (avocado-vt / avocado-i2n) enabled?
* the exact OS / Python version?

It would also be helpful if you can send a reproduced to some of the enabled CI systems here.  I do find Cirrus CI pretty easy to add a bunch of commands demonstrating the issue.
Hi @beraldoleal,

> Hi @pevogam , let me explain a little better:
> 
> Those 2 lines are there to make sure we are not disabling the root log state.

I see and this makes sense. My disabling of the two lines above was the result of a quick trial and error searching for a minimal reverting change to make things work again, I didn't apply any logic or heuristic or investigate the reasons for this. I could do some dumping of loggers that are passed to the function later on if you are interested. In fact I just did a bit and I can see that there are two instances when `if not logger` from the two lines is true, both cases have an empty string passed as the logger. I suppose then one of these two instances is not supposed to result in `return`.

> Here I'm having the same result as @willianrampazzo, and I cant reproduce. So seems to be some custom settings or something else. As @willianrampazzo mention it seems to be related to sysinfo. Maybe do you have any custom sysinfo commands/profilers (/etc/avocado/sysinfo/*)?

Nothing custom and everything I use is default there. From the other issue it seems that more is printed out and in my case it could be just sysinfo since I ran a trivial /bin/true test. I did get more output on less trivial VT tests that wasn't just about sysinfo.

> Can you please also double check if you have any other config file in place? (avocado config | head -20)

I do have more configs, some vt configs and one tiny extra config:

```
[root@c60]# avocado config | head -20 
Config files read (in order, '*' means the file exists and had been read):
    * /etc/avocado/avocado.conf
    * /etc/avocado/conf.d/vt_joblock.conf
    * /etc/avocado/conf.d/vt.conf
    * /etc/avocado/conf.d/i2n.conf
```

but not much can be seen there

```
[root@c60]# cat /etc/avocado/conf.d/i2n.conf 
[i2n.common]
# Top path for the test suite
# ---------------------------
# Minimal assumptions for the test suite structure is that
# it contains a "tests" folder where the tests are placed,
# a "configs" folder where the Cartesian configs should be
# found, and a "utils" folder where all code shared among
# tests should be placed.
suite_path = /mnt/local/intra2net-qa/tp_i2n
[root@c60]# cat /etc/avocado/conf.d/vt.conf
[vt.setup]
# Backup image before testing (if not already backed up)
#backup_image_before_test = True
# Restore image after testing (if backup present)
#restore_image_after_test = True
# Keep guest running between tests (faster, but unsafe)
#keep_guest_running = False

[vt.common]
# Data dir path. If none specified, the default virt-test data dir will be used
#data_dir =
# Make the temporary dir path persistent across jobs if needed.
# By default the data in the temporary directory will be wiped after each test
# in some cases and after each job in others.
tmp_dir = /tmp
# Enable only type specific tests. Shared tests will not be tested
#type_specific_only = False
# RAM dedicated to the main VM
# Usually defaults to 1024, as set in "base.cfg", but can be a different
# value depending on the various other configuration files such as
# configuration files under "guest-os" and test provider specific files
#mem =
# Architecture under test
#arch =
# Machine type under test
#machine_type =
# Nettype (bridge, user, none)
#nettype =
# Bridge name to be used if you select bridge as a nettype
#netdst = virbr0

[vt.qemu]
# Path to a custom qemu binary to be tested
#qemu_bin =
# Path to a custom qemu binary to be tested for the
# destination of a migration, overrides qemu_bin for
# that particular purpose
#qemu_dst_bin =
# Accelerator used to run qemu (kvm or tcg)
#accel = kvm
# Whether to enable vhost for qemu (on/off/force). Depends on nettype=bridge
#vhost = off
# Monitor type (human or qmp)
#monitor =
# Number of virtual cpus to use (1 or 2)
#smp = 2
# Image format type to use (any valid qemu format)
#image_type = qcow2
# Guest network card model (any valid qemu card)
#nic_model = virtio_net
# Guest disk bus for main image. One of
# ('ide', 'scsi', 'virtio_blk', 'virtio_scsi', 'lsi_scsi', 'ahci', 'usb2', 'xenblk')
# Note: Older qemu versions and/or operating systems might not support
#       "virtio_scsi" (WinXP) Please use virtio_blk" or "ide" instead.
#disk_bus = virtio_scsi
# Enable qemu sandboxing (on/off)
#sandbox = on
# Prevent qemu from loading sysconfdir/qemu.conf and sysconfdir/target-ARCH.conf at startup
# (yes/no)
#defconfig = yes
# Use MALLOC_PERTURB_ env variable set to 1 to help catch memory allocation problems on qemu
# (yes/no)
#malloc_perturb = yes

[vt.libvirt]
# Test connect URI for libvirt (qemu:///system', 'lxc:///')
#connect_uri = qemu:///session

[vt.debug]
# Don't clean up tmp files or VM processes at the end of a virt-test execution
#no_cleanup = False
```

> For sure, we still need some adjustment but would be nice to have a reproducer.

I totally agree, I am still unclear why it isn't reproducible on your side and I still haven't excluded some customization. Can you think of any obvious options that I could have set wrong?
Hi @clebergnu thanks to both @beraldoleal and you for taking the time to look into this, I just hope that I don't waste your time with something that could be the result of customization which is why this issue is not meant to be any blocker for the 90.0 release or any later process. Feel free to continue with your release without being bothered by this issue until I can investigate more. My posting was mostly about any potential quick feedback on causes.

> @pevogam we definitely need to get down to the cause of the issue you are seeing. If we can not isolate to Avocado, we need to look into other aspects, so it would make sense to look into the environment you are using. Could you please share:
> 
>     * If you have plugins (avocado-vt / avocado-i2n) enabled?

Yes which is one of my my main concerns as we only run somewhat enhanced virtualization tests.

>     * the exact OS / Python version?

Fedora 33 LXC container, Python 3.9.

> 
> It would also be helpful if you can send a reproduced to some of the enabled CI systems here. I do find Cirrus CI pretty easy to add a bunch of commands demonstrating the issue.

Unfortunately, the CI is internal and fully customized for the company infrastructure but I could share output from the avocado run itself. I just modified the two lines returning from empty loggers like this
```python
    if not logger:
        print(f"Passed logger: '{logger}' of type {type(logger)}")
        import traceback
        traceback.print_stack()
        return
```
and the output I get is:
```
[root@c60 intra2net-qa]# avocado run /bin/true
Passed logger: '' of type <class 'str'>
  File "/usr/bin/avocado", line 33, in <module>
    sys.exit(load_entry_point('avocado-framework==89.0', 'console_scripts', 'avocado')())
  File "/usr/lib/python3.9/site-packages/avocado/core/main.py", line 81, in main
    app = AvocadoApp()
  File "/usr/lib/python3.9/site-packages/avocado/core/app.py", line 74, in __init__
    output.reconfigure(self.parser.config)
  File "/usr/lib/python3.9/site-packages/avocado/core/output.py", line 480, in reconfigure
    disable_log_handler("")
  File "/usr/lib/python3.9/site-packages/avocado/core/output.py", line 650, in disable_log_handler
    traceback.print_stack()
Passed logger: '' of type <class 'str'>
  File "/usr/bin/avocado", line 33, in <module>
    sys.exit(load_entry_point('avocado-framework==89.0', 'console_scripts', 'avocado')())
  File "/usr/lib/python3.9/site-packages/avocado/core/main.py", line 82, in main
    return app.run()
  File "/usr/lib/python3.9/site-packages/avocado/core/app.py", line 112, in run
    return method(self.parser.config)
  File "/usr/lib/python3.9/site-packages/avocado/plugins/run.py", line 304, in run
    with job.Job(config, [suite]) as job_instance:
  File "/usr/lib/python3.9/site-packages/avocado/core/job.py", line 191, in __enter__
    self.setup()
  File "/usr/lib/python3.9/site-packages/avocado/core/job.py", line 653, in setup
    output.reconfigure(self.config)
  File "/usr/lib/python3.9/site-packages/avocado/core/output.py", line 480, in reconfigure
    disable_log_handler("")
  File "/usr/lib/python3.9/site-packages/avocado/core/output.py", line 650, in disable_log_handler
    traceback.print_stack()
JOB ID     : b1a8764d36f95df85c0fe183d9a3efc91b658567
JOB LOG    : /mnt/local/results/job-2021-07-23T19.43-b1a8764/job.log
INFO:avocado.sysinfo:Commands configured by file: /etc/avocado/sysinfo/commands
INFO:avocado.sysinfo:Files configured by file: /etc/avocado/sysinfo/files
DEBUG:avocado.sysinfo:File /usr/lib/python3.9/site-packages/avocado/etc/avocado/sysinfo/fail_commands does not exist.
DEBUG:avocado.sysinfo:File /usr/lib/python3.9/site-packages/avocado/etc/avocado/sysinfo/fail_files does not exist.
INFO:avocado.sysinfo:Profilers configured by file: /etc/avocado/sysinfo/profilers
INFO:avocado.sysinfo:Profiler disabled
DEBUG:avocado.sysinfo:Not logging /sys/kernel/debug/sched_features (file does not exist)
DEBUG:avocado.sysinfo:Not logging /proc/pci (file does not exist)
 (1/1) /bin/true: PASS (0.02 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
DEBUG:avocado.sysinfo:Not logging /sys/kernel/debug/sched_features (file does not exist)
DEBUG:avocado.sysinfo:Not logging /proc/pci (file does not exist)
JOB HTML   : /mnt/local/results/job-2021-07-23T19.43-b1a8764/results.html
JOB TIME   : 0.88 s
```
so it must be that at least one of these two cases must not `return` in order for the logging to work properly.

Resolving patch:
diff --git a/avocado/core/output.py b/avocado/core/output.py
--- a/avocado/core/output.py
+++ b/avocado/core/output.py
@@ -477,7 +477,7 @@ def save_handler(logger_name, handler, configuration):
                                       STD_OUTPUT.stdout, logging.DEBUG)
             save_handler(LOG_JOB.name, handler, configuration)
         else:
-            disable_log_handler("")
+            disable_log_handler("avocado")
     # Not enabled by env
     if not os.environ.get('AVOCADO_LOG_DEBUG'):
         if "debug" in enabled:


Test patch: