Unable to set no-color log output

Bug #2038917 reported by Yong-Hwan Baek
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
oslo.log
In Progress
Wishlist
Takashi Kajinami

Bug Description

Hello

I am building a custom app using oslo.log running on apache httpd server. (We use olso to communicate with openstack services)
This app is deployed in kubernetes environment, so logs are collected through fluentd or like that.

In this situation every log prints ascii escape character(\x1b[00m) to reset terminal color.

Unfortunately, there is no way to remove or disable ascii escape character.
In configuration file setup process, every option fallbacks to ColorHandler.(https://opendev.org/openstack/oslo.log/src/commit/b5b8c30b0d925aa3d31b58932c94586631827b62/oslo_log/log.py#L365)

There are three handlers implemented (syslog, journal, color) but non of those can generate plain text without console color characters. (see. https://opendev.org/openstack/oslo.log/src/branch/master/oslo_log/handlers.py)

Could be a workaround to solve this issue?

Changed in oslo.log:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.log (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/oslo.log/+/914791

Changed in oslo.log:
status: Confirmed → In Progress
Revision history for this message
Takashi Kajinami (kajinamit) wrote :

This is considered a new feature rather than bug fix. We can add a new option but this is not backportable.

One potential workaround is using json format logs, or somehow drop the color tags before/after the logs are processed by fluenntd.

Changed in oslo.log:
assignee: nobody → Takashi Kajinami (kajinamit)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.