Giter Club home page Giter Club logo

dozzle's Introduction

Dozzle - dozzle.dev

Dozzle is a small lightweight application with a web based interface to monitor Docker logs. It doesn’t store any log files. It is for live monitoring of your container logs only.

dozzle-dark.mp4

Go Report Card Docker Pulls Docker Version Test

Features

  • Intelligent fuzzy search for container names 🤖
  • Search logs using regex 🔦
  • Small memory footprint 🏎
  • Split screen for viewing multiple logs
  • Download logs easily
  • Live stats with memory and CPU usage
  • Multi-user authentication with support for proxy forward authorization 🚨

Dozzle has been tested with hundreds of containers. However, it doesn't support offline searching. Products like Loggly, Papertrail or Kibana are more suited for full search capabilities.

Getting Started

Dozzle is a small container (4 MB compressed). Pull the latest release with:

$ docker pull amir20/dozzle:latest

Running Dozzle

The simplest way to use dozzle is to run the docker container. Also, mount the Docker Unix socket with --volume to /var/run/docker.sock:

$ docker run --name dozzle -d --volume=/var/run/docker.sock:/var/run/docker.sock -p 8888:8080 amir20/dozzle:latest

Dozzle will be available at http://localhost:8888/.

Here is the Docker Compose file:

version: "3"
services:
  dozzle:
    container_name: dozzle
    image: amir20/dozzle:latest
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - 8888:8080

For advanced options like authentication, remote hosts or common questions see documentation at dozzle.dev.

Technical Details

Dozzle users automatic API negotiation which works with most Docker configurations. Dozzle also works with Colima and Podman.

Installation on podman

By default Podman doesn't have a background process but you can enable this for Dozzle to work.

Verify first if your podman installation has enabled remote socket:

podman info

When you get under the key remote socket output like this, its already enabled:

  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock

If it's not enabled please follow this tutorial to enable it.

Once you have the podman remote socket you can run Dozzle on podman.

podman run --volume=/run/user/1000/podman/podman.sock:/var/run/docker.sock -d -p 8888:8080 amir20/dozzle:latest

Security

Dozzle supports file based authentication and forward proxy like Authelia. These are documented at https://dozzle.dev/guide/authentication.

Analytics collected

Dozzle collects anonymous user configurations using Google Analytics. Why? Dozzle is an open source project with no funding. As a result, there is no time to do user studies of Dozzle. Analytics is collected to prioritize features and fixes based on how people use Dozzle. This data is completely public and can be viewed live using Data Studio dashboard.

If you do not want to be tracked at all, see the --no-analytics flag below.

Environment variables and configuration

Dozzle follows the 12-factor model. Configurations can use the CLI flags or environment variables. The table below outlines all supported options and their respective env vars.

Flag Env Variable Default
--addr DOZZLE_ADDR :8080
--base DOZZLE_BASE /
--hostname DOZZLE_HOSTNAME ""
--level DOZZLE_LEVEL info
--auth-provider DOZZLE_AUTH_PROVIDER none
--auth-header-user DOZZLE_AUTH_HEADER_USER Remote-User
--auth-header-email DOZZLE_AUTH_HEADER_EMAIL Remote-Email
--auth-header-name DOZZLE_AUTH_HEADER_NAME Remote-Name
--enable-actions DOZZLE_ENABLE_ACTIONS false
--wait-for-docker-seconds DOZZLE_WAIT_FOR_DOCKER_SECONDS 0
--filter DOZZLE_FILTER ""
--no-analytics DOZZLE_NO_ANALYTICS false
--remote-host DOZZLE_REMOTE_HOST

Support

There are many ways you can support Dozzle:

  • Use it! Write about it! Star it! If you love Dozzle, drop me a line and tell me what you love.
  • Blog about Dozzle to spread the word. If you are good at writing send PRs to improve the documentation at dozzle.dev
  • Sponsor my work at https://www.buymeacoffee.com/amirraminfar

Buy Me A Coffee

License

MIT

Building

To Build and test locally:

  1. Install NodeJs and pnpm.
  2. Install Go.
  3. Install reflex with go install github.com/cespare/reflex@latest.
  4. Install node modules pnpm install.
  5. Run make dev to start a development server.

dozzle's People

Contributors

ab623 avatar akash-ramaswamy avatar amadeusgraves avatar amir20 avatar c-w avatar codeman1o1 avatar coteh avatar dependabot-preview[bot] avatar dependabot[bot] avatar dima-bzz avatar ediflyer avatar fabeuss avatar feriman22 avatar flamestro avatar fredskis avatar github-actions[bot] avatar iwittkau avatar kodiakhq[bot] avatar lovelesscodes avatar m1ome avatar manimatter avatar marcinwolosz avatar peterdavehello avatar pothitos avatar rafipiccolo avatar renovate[bot] avatar rm-hull avatar sureshram avatar tuurlijk avatar vanodevium avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dozzle's Issues

Full Dozzle Log not available - limited scroll back

Hi. When I check dozzle on one of my containers, I can only scroll back around 200 lines. But the docker container itself has thousands of lines when I attach to the docker logs directly.

How can I change the lookback limit so it shows me the full docker log in dozzle?

Thanks!

Organization of Container List

I have one bug, and two requests/questions for the list of containers on the left of the page. For the bug, when you have more containers than fit on the screen, there is no way to access the lower ones. Scrolling only scrolls the logs, not the container list.

For the organization, it appears to be sorted by when the container was created. Is there a way to sort alphabetically? Also, each container name is preceded by a slash. Is there a reason behind that, or can it be removed. This also affects the title bar, ie the title is /nginx - Dozzle rather than nginx - Dozzle.

Unable to see logs

I am unable to see logs of few of the containers. The logs do show up when I simply run the command docker logs <container-id>. How do I trouble shoot this?

invalid filter status=running

https://github.com/amir20/dozzle#with-docker-compose writes:

version: "3"
services:
  dozzle:
    container_name: dozzle
    image: amir20/dozzle:latest
    environment:
      - DOZZLE_TAILSIZE=100
      - DOZZLE_FILTER='status:running'
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - 9999:8080

But if I try that, I get:

dozzle      | time="2020-02-26T19:14:29Z" level=info msg="Parsing 'status:running'"
dozzle      | level=info msg="Dozzle version 1.20.20"
dozzle      | level=fatal msg="Could not connect to Docker Engine: Error response from daemon: Invalid filter ''status:running''"

filter for dozzle

Hello, is there a way to filter the messages of a container ?
For example, we use in the log messages a level and the message is a json object.


{ ... ,"level": 400, ... }


I will find all log messages with level >= 400.

Is there a way ?

Your sincerly

Stephan

Support HTTPS/WSS

I have Dozzle reverse proxied with SSL. The main page loads, but the websocket connections do not:

Mixed Content: The page at 'https://URL/dozzle/container/ID' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://URL/dozzle/api/logs?id=ID'. This request has been blocked; this endpoint must be available over WSS.

I have websocket proxying setup in NGINX, but it seems like Dozzle is still looking for a ws:// connection. NGINX doesn't show any logs, so it is being blocked in the browser and not even making it to my proxy.

If I temporarily allow unsafe connections, Dozzle exits with this error:

2018/11/19 21:48:00 websocket: request origin not allowed by Upgrader.CheckOrigin

Option to turn off time

Currently Dozzle includes today at 9:29 AM in each line.

Since the log itself have timestamp, its possible for us to hide this?

Thanks in advance.

Docker image not compatible with arm32v6

Hi all,
the project seems very good! I want to use it on my Raspberry server, but I cannot do it because the docker image is not arm32v6 compatible.

I tried to fork the repo, modify the Dockerfile to use a arm32v6/alpine:latestas base image but it doesn't work.

Problem 1: build image failed from within the nozzle folder

The first problem that I got is that I was unable to build the image from within the repo folder. The steps that I followed are the following:

  1. Create a new Dockerfile and use arm32v6/alpine:latest as base image
  2. Build the image locally:
cd dozzle
docker build -t bubidevs/dozzle:latest -f Dockerfile-arm32v7 .

Here I got an error on the last build step:

Step 7/8 : COPY dozzle /
COPY failed: stat /var/lib/docker/tmp/docker-builder446079037/dozzle: no such file or directory

Problem 2: image built but not working

To solve the issue, I went back outside the dozzle folder and built the image in this way:

cd ..
docker build -t bubidevs/dozzle:latest -f dozzle/Dockerfile-arm32v7 .

In this way I was able to build the image, but when I try to create a container, it fails with this error:

ERROR: for dozzle  Cannot start service dozzle: OCI runtime create failed: container_linux.go:346: starting container process caused "exec: \"/dozzle\": stat /dozzle: no such file or directory": unknown

Could you please help me?

Many thanks in advice!

ARM version?

Hi

I'm trying to run Dozzle on my Raspberry PI but after creating the container and trying to run it I just get:

standard_init_linux.go:211: exec user process caused "exec format error"

I think it's because of my architecture since there's no ARM build?

filter by date

Hello,

is there a way to filter the log messages by date.
When i press the Strg + Shift buttons i see the search field.
Can i enter a date like 'now' or 'yesterday'.

Your sincerly

Stephan

Thanks

Hello Amir,

Thanks for the good tool.
We use for our project this tool.
On our docker host there are many docker containers.
It is usefull to see the log messages from a single container.

Have a good Christmas time.

Your sincerly

Stephan

Dependabot can't resolve your Go dependency files

Dependabot can't resolve your Go dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

go: github.com/docker/[email protected]: reading github.com/docker/go-units/go.mod at revision v0.4.0: unknown revision v0.4.0

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Auto update doesn't work sometimes

Related to

With the new version, the logs do not auto-update reliably, however. They seem to only update every few minutes. Is that a bug, or will continuous updating not work with server events?

@kmlucy I am leaving this as a placeholder until we can debug it.

Older Docker version

Is it possible to run this fantastic piece of software using an older Docker version (specifically the 1.18)?

Sadly my Synology DSM doesn't support a newer version of it in the store.

Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): a263667
OS/Arch (client): linux/amd64
Server version: 1.6.2
Server API version: 1.18
Go version (server): go1.4.2
Git commit (server): a263667
OS/Arch (server): linux/amd64

Thinner scrollbars & double scrollbar?

There's not a ton of space if you put 2 or 3 logs up side-by-side. May I suggest a few improvements?

  1. Have a [hamburger] button to hide the dozzle/sidebar menu
  2. Make the scrollbars thinner
  3. There's a double scrollbar on the far right. I think the outer one is for the whole window/html but it doesn't need to be there at all.

Great project BTW. I was looking for a nice simple alternative to the other Docker UIs out there and this is perfect! So thank you.

Scrolling is broken on mobile

The log viewer is not perfect. Because overflow: auto is used to show multiple panels, in mobile view, it doesn't look really good with touch.

Performance issue

Isues

  1. Takes long time to load initial log data
  2. Getting new logs after a long delay
  3. Sometimes updates wont come at all

RangeError: Invalid time value when new log appear

Hey, it's me, again 🗡

After having you help me a lot here, I encountered another error.

As before, if this is only reproduceable on my particular environment and/or it is too much to fix (if there is anything to fix).

Now, when the logs are fully loaded after clicking on them, if a new line of the log appear, instead of adding it to the bottom it only goes with RangeError: Invalid time value in the console.

If I click on another container, then again in the same as before, of course it updates the entire thing.

Feature Enhancements

Just installed Dozzle and very cool and useful. =)

Right off the bat I notice something that it seems to be missing that would make it much more useful and "powerful"; the ability to split the main window into smaller ones, and open other logs in them.

i.e. open up 2 different logs side by side, or 4 separate logs in 4 smaller "windows", all on the same screen, so you can monitor more than 1 log at a time if/when needed.

--

The ability to change the font sizes and colors as well. (without having to hack the .css ourselves)

--

And also, the ability to have better automatic coloring of the contents of the logs to make things easier to quickly glean info from at quick glances. Maybe some RegEx adding ability?

Is it possible to add custom tailing?

I would also like to add some other things that I can watch in the list. For example, inside of the LetsEncrypt (Nginx) container there are access.log and error.log that reside inside /config/log/nginx.

Is there some way I can specifically add /config/log/nginx/access.log and /config/log/nginx/error.log to the list of logs?

thanks!
Kacey

Dozzle fails to load stream for Docker-compose with flag `tty:True`

The dozzle output remains blank and the network tab of the browser shows the /stream?id=###### API call to never start nor finish. It receives no data back.

Steps to reproduce

  • Start any gekkobot container
  • Start Dozzle
  • Try to connect to the gekkobot container output in Dozzle

I really want this to work, because Dozzle is perfect for viewing the output of an automated trading bot.

This is an example of the output from a Gekko container straight from docker CLI

Creating gekkobot_gekko-cli-test ... done
Attaching to gekkobot_gekko-cli-test
gekko-cli-test  | 
gekko-cli-test  |     ______   ________  __    __  __    __   ______
gekko-cli-test  |    /      \ /        |/  |  /  |/  |  /  | /      \
gekko-cli-test  |   /$$$$$$  |$$$$$$$$/ $$ | /$$/ $$ | /$$/ /$$$$$$  |
gekko-cli-test  |   $$ | _$$/ $$ |__    $$ |/$$/  $$ |/$$/  $$ |  $$ |
gekko-cli-test  |   $$ |/    |$$    |   $$  $$<   $$  $$<   $$ |  $$ |
gekko-cli-test  |   $$ |$$$$ |$$$$$/    $$$$$  \  $$$$$  \  $$ |  $$ |
gekko-cli-test  |   $$ \__$$ |$$ |_____ $$ |$$  \ $$ |$$  \ $$ \__$$ |
gekko-cli-test  |   $$    $$/ $$       |$$ | $$  |$$ | $$  |$$    $$/ 
gekko-cli-test  |    $$$$$$/  $$$$$$$$/ $$/   $$/ $$/   $$/  $$$$$$/
gekko-cli-test  | 
gekko-cli-test  | 	Gekko v0.6.8
gekko-cli-test  | 	I'm gonna make you rich, Bud Fox. 
gekko-cli-test  | 
gekko-cli-test  | 
gekko-cli-test  | 2019-10-29 15:22:40 (INFO):	Setting up Gekko in realtime mode
gekko-cli-test  | 2019-10-29 15:22:40 (INFO):	
gekko-cli-test  | 2019-10-29 15:22:40 (INFO):	Setting up:
gekko-cli-test  | 2019-10-29 15:22:40 (INFO):		 Candle writer
gekko-cli-test  | 2019-10-29 15:22:40 (INFO):		 Store candles in a database
gekko-cli-test  | 2019-10-29 15:22:40 (INFO):	
gekko-cli-test  | 
gekko-cli-test  | 2019-10-29 15:22:40 (INFO):	Setting up:
gekko-cli-test  | 2019-10-29 15:22:40 (INFO):		 Trading Advisor
gekko-cli-test  | 2019-10-29 15:22:40 (INFO):		 Calculate trading advice

Dozzle is working for any other container and shows the output, but strangely I do see a console error

Firefox can’t establish a connection to the server at https://dozzle.domain.com/api/events/stream. main.b644d699.js:12:278
The connection to https://dozzle.domain.com/api/logs/stream?id=################ was interrupted while the page was loading.

Even with that error, it still loads the stream for the non gekko containers. Any idea why it won't load the gekko container stream, with no response from the API?

And, what is the meaning of the console error for the containers even when it loads fine?

Base URL

Is there a way to set a base URL? I'd like to run Dozzle at /dozzle/, instead of at /.

Restrict To Specific Containers

I'm wondering if it would be possible to restrict the list of availble containers?
E.g 1 host with 2 projects, would be good if you could restict to only show containers from 1 project

custom ports

for custom port usage with command
$ docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8888:1224 amir20/dozzle:latest --addr localhost:1224

you still get access to localhost:8080 due to hardcoded port in Dockerfile
ENTRYPOINT ["/dozzle"]
EXPOSE 8080

[Feature request] Concatainer log?

Hello:)

What do you think about adding the possibility to concatenate logs with a possibility to ignore based on the container name?

Regards,

error in date format parsing in logs

At first i did a Clean install and everything works :)

Then I install loki's docker log plugin to redirect all logs to loki :
it keeps the default json log of docker.
https://github.com/grafana/loki/tree/master/cmd/docker-driver
Every logs gets redirected to loki as expected and everything continue working.

  • docker logs : OK (because loki's plugin is also writing json logs file as usual)
  • portainer : OK (can show this logs too)
  • Dozzle : KO :(

I think its related to the date format :
in your event stream (https://dozzle.flatbay.fr/api/logs/stream?id=c958bfe53d2a)
i can see the following

Data: 2020-04-27T10:52:09.307471665Z xxxxxx

with loki's pluggin enabled i can see

Data: 2020-04-27T12:35:43.272974324+02:00 xxxxx

While both formats are correct, and means the same, you seem to only parse the first succesfully.
Which results in an empty black screen for me.

Could you detect this format, or at least show the line without formating date when you can't parse the date ?

thanks.

Optional coloring support

Hello! First of all, thanks for the tool!
Looks like it doesn't understand colors. Can you add optional support for ANSI escape codes?
Screenshot 2019-06-13 at 12 12 22

Simple Storage

Like in a SQLite db, nothing complex or dependency heavy.

Dozzle doesn't escape angle brackets <> resulting in missing text

A lot of my log text contains angle brackets <> and dozzle just pipes it directly into the page source without escaping it, resulting in my browser treating a lot of my log text as HTML tags. Can you update the ansi-to-html converter to use the escapeXML option, or at least add an option to do so?

DOZZLE_FILTER env is not working

DOZZLE_FILTER is not working for me. Any Idea what I'm doing wrong?

Here how I use it:

docker run -e DOZZLE_FILTER='nginx' --volume=/var/run/docker.sock:/var/run/docker.sock -p 8081:8080 amir20/dozzle:latest

Container is immediately crashing with following error:

time="2019-12-02T09:30:25Z" level=info msg="Parsing nginx"
level=info msg="Dozzle version 1.17.0"
level=fatal msg="Could not connect to Docker Engine: Error response from daemon: Invalid filter 'nginx'"

[FEATURE REQUEST] Support regular expression in Find

First of all thanks a lot for this great project!

I was wondering if it is hard to add an option to do regular expression searches? This would be super helpful especially when you are searching for more generic patterns within the logs.

Thanks!

[Feature Request] Menu auto-collapse after selecting container

When viewing on mobile I'd really like to see the menu auto-collapse after selecting a container to view

  • currently with a large number of containers, it's a quite difficult to quickly switch between containers (this is only a problem for me when viewing on mobile)

Multiple filters?

Is it possible to have multiple dozzle_filters? What would be the syntax?

Log4j stacktrace appends time to every line

Log4j stacktrace appends time to every line, it should append it just to the first line and for the rest leave a tab.

Any idea on how to quickly fix this or I guess I will look over the code and try to contribute.

Thanks
Radu

Unable to see logs, 1min TTFB

Looks like I'm running in same issue as #13

Locally it works fine, api/logs/stream returns some data almost immediately (<40ms)

But in our staging environment it takes ages to load some data, some request are running into timeouts without returning any data. I found out that only running containers are affected. Logs for stopped containers are available immediately. There seems to be some problem with requesting log data from docker, but docker logs forks fine. Any idea how I can debug it, any docker configs I can play with?

Screenshot 2019-12-02 at 18 46 13

Following errors are appearing in the browser console:
Screenshot_2019-12-02_at_18_50_43

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.