Git Product home page Git Product logo

Comments (7)

MattJeanes avatar MattJeanes commented on September 21, 2024 1

If you add --timestamp onto the docker-compose logs you will get the timestamp info for TeslaMateAgile, but this will cause double timestamps for things like TeslaMate.

If you want the app to directly output timestamps in the same style as TeslaMate itself you can add the following environment variables:

- Logging__Console__FormatterName=simple
- "Logging__Console__FormatterOptions__TimestampFormat=yyyy-MM-dd hh:mm:ss.fff "

Note that quote marks around the second one are needed as there should be a space at the end of the timestamp format.

That will look like this:

matt@abyss:~$ sudo docker logs teslamateagile --since 1m -f
2021-07-04 03:01:00.871 info: TeslaMateAgile.PriceService[0]
      Price service is starting
2021-07-04 03:01:00.875 info: TeslaMateAgile.PriceService[0]
      Using energy provider FixedPrice
2021-07-04 03:01:00.876 info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
2021-07-04 03:01:00.878 info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
2021-07-04 03:01:00.878 info: Microsoft.Hosting.Lifetime[0]
      Content root path: /app/
2021-07-04 03:01:02.279 info: TeslaMateAgile.PriceHelper[0]
      No new charging processes
2021-07-04 03:01:02.282 info: TeslaMateAgile.PriceService[0]
      Waiting 300 seconds until next update

Check out this page for options on what formats you can use: https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings

I have now also removed the Updating prices log message to reduce confusion, this will go out in the next release v1.7.0.

I've also added to the README about how to enable timestamps as above too so others can do the same if they wish.

Hopefully this is what you were looking for ๐Ÿ˜„

from teslamateagile.

MattJeanes avatar MattJeanes commented on September 21, 2024 1

Good spot! I will update the readme accordingly, glad it's all working for you ๐Ÿ™‚

from teslamateagile.

MattJeanes avatar MattJeanes commented on September 21, 2024

Hey there, for timestamps I recommend using the docker built in options to show timestamps: https://docs.docker.com/compose/reference/logs/

As for the updating prices, it's a bit of a misleading log really that's just what it says every time it checks to see if there is any new charges to calculate cost for

Hope this helps!

from teslamateagile.

MattJeanes avatar MattJeanes commented on September 21, 2024

Hopefully that's solved your issues. I will change the log message about updating prices to reduce confusion as I agree it is misleading.

from teslamateagile.

jrothlis avatar jrothlis commented on September 21, 2024

Sorry for the late reply... This is what I mean about the logging, if I issue "docker-compose logs" I get the teslamate logs nicely time-stamped, but the teslamateagile logs are very sparse:

<snip>
teslamate_1       | 2021-06-27 16:52:52.541 [info] GET /public/build/moment~app.fd61e9de3c3d9b43f138.js
teslamate_1       | 2021-06-27 16:52:52.541 [info] Sent 404 in 244ยตs
teslamate_1       | 2021-06-27 16:52:52.542 [info] GET /public/build/unicons~app.fd61e9de3c3d9b43f138.js
teslamate_1       | 2021-06-27 16:52:52.543 [info] Sent 404 in 159ยตs
teslamateagile_1  | info: TeslaMateAgile.PriceHelper[0]
teslamateagile_1  |       Updating prices
teslamateagile_1  | info: TeslaMateAgile.PriceHelper[0]
teslamateagile_1  |       No new charging processes
<snip>

from teslamateagile.

jrothlis avatar jrothlis commented on September 21, 2024

Thanks, perfect!!

from teslamateagile.

jrothlis avatar jrothlis commented on September 21, 2024

Note that the formatting should be like this for 24h format (HH rather than hh):

- "Logging__Console__FormatterOptions__TimestampFormat=yyyy-MM-dd HH:mm:ss.fff "

from teslamateagile.

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.