Giter Site home page Giter Site logo

Could we format logs better? about azurite HOT 9 CLOSED

azure avatar azure commented on July 3, 2024
Could we format logs better?

from azurite.

Comments (9)

edwin-huber avatar edwin-huber commented on July 3, 2024 1

Thanks.
I'll mark this as a good first issue and hopefully somebody can get around to looking at it soon.

We use morgan middleware for the logging, which is documented here:
https://github.com/expressjs/morgan

to give you the date and unformatted version like you are asking for, one would need to usesomething like:

if (!env.silent) {
    app.use(morgan(':date[iso] :method :url :status :res[content-length] - :response-time ms'));
} 

from azurite.

pmanlukas avatar pmanlukas commented on July 3, 2024 1

I will start implementing this change in this week

from azurite.

longtimeago avatar longtimeago commented on July 3, 2024

Maybe, we could have an environment variable to optionally switch log coloring off

from azurite.

edwin-huber avatar edwin-huber commented on July 3, 2024

Many thanks for your suggestion.

What exactly are you looking to get out of the logging / how are you using it?
This will help me define some requirements and scope to improve it.
Logging is turned off with the --silent switch.
Ascii greeting is in lib/core/cli.js

logging is controlled by 'morgan' in AzuriteBlob.js, AzuriteQueue.js, AzuriteTable.js
like this:

const app = express();
                if (!env.silent) {
                    app.use(morgan('dev'));
                }

from azurite.

longtimeago avatar longtimeago commented on July 3, 2024

@edwin-huber Thanks for the hint :)

I've mixed 2 issues in one (sorry for that)

  1. I'd like to have a way to turn off log coloring via (for example) special env variable. So, when opening logs in ordinary text editor instead of
�[0mGET /account/customer?restype=container&comp=list �[32m200 �[0m19.399 ms - 255�[0m

I would see

GET /account/customer?restype=container&comp=list 32m19.399 ms 

Usually, we forward our logs to logstash, where this coloring not needed as well :)

  1. In each log entry instead of a relative time from container start would be very nice to have absolute timestamp. Otherwise, it's really tricky to match log entries in different log files

from azurite.

pmanlukas avatar pmanlukas commented on July 3, 2024

I will look into the logging

from azurite.

PureKrome avatar PureKrome commented on July 3, 2024

Was there any resolution to this issue?

Is there a way to turn off logging via an environmental variable, so we can set that in our docker/docker-compose files?

from azurite.

edwin-huber avatar edwin-huber commented on July 3, 2024

Logging has been re-implemented since this issue was opened.
If there are still specific feature requests around logging, please let us know.

from azurite.

PureKrome avatar PureKrome commented on July 3, 2024

@edwin-huber 👋🏻 Hi!

Logging has been re-implemented since this issue was opened.

are there any details about this? as in, what was actually re-implemented (on a high level)?

For example: can logging be turned off via an env-var, now?


EDIT: I'm guessing i might be answering my own question now .. but the README was the place with this info is now explaining this?

https://github.com/Azure/Azurite#debug-log-configuration

Is this the main change(s) to logging?

from azurite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.