All Projects → shufo → log_viewer

shufo / log_viewer

Licence: MIT License
An Web based Log Viewer for Elixir and Phoenix

Programming Languages

elixir
2628 projects
Vue
7211 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Labels

Projects that are alternatives of or similar to log viewer

mishka-cms
MishkaCms an open source and real time API base CMS Powered by Elixir and Phoenix
Stars: ✭ 37 (-35.09%)
Mutual labels:  phoenix
opensubs.io
💸 Track recurring bills and subscriptions
Stars: ✭ 37 (-35.09%)
Mutual labels:  phoenix
game of life-elixir
An implementation of Conway's Game of Life in Elixir
Stars: ✭ 22 (-61.4%)
Mutual labels:  phoenix
hadoop-data-ingestion-tool
OLAP and ETL of Big Data
Stars: ✭ 17 (-70.18%)
Mutual labels:  phoenix
tarams
Casting and validating external data and request parameters in Elixir and Phoenix
Stars: ✭ 40 (-29.82%)
Mutual labels:  phoenix
elixir cluster
Distributed Elixir Cluster on Render with libcluster and Mix Releases
Stars: ✭ 15 (-73.68%)
Mutual labels:  phoenix
mindwendel
Create a challenge. Ready? Brainstorm. mindwendel helps you to easily brainstorm and upvote ideas and thoughts within your team.
Stars: ✭ 22 (-61.4%)
Mutual labels:  phoenix
plug rails cookie session store
Rails compatible Plug session store
Stars: ✭ 93 (+63.16%)
Mutual labels:  phoenix
ecto generator
Generate Ecto schemas from existing database in Phoenix - Elixir
Stars: ✭ 20 (-64.91%)
Mutual labels:  phoenix
one plus n detector
Elixir library to help you detect 1+n queries in applications using Ecto
Stars: ✭ 20 (-64.91%)
Mutual labels:  phoenix
phoenix oauth2 provider
Get an OAuth 2 provider running in your phoenix with controllers, views and models in just two minutes
Stars: ✭ 72 (+26.32%)
Mutual labels:  phoenix
pryin
PryIn is an Application Performance Monitoring platform for your Elixir/Phoenix application.
Stars: ✭ 25 (-56.14%)
Mutual labels:  phoenix
Claymore-nodevfee-Linux
The first Linux ETH miner with nodevfee or devfee removed/市面上第一个基于Linux的ETH反抽水软件!
Stars: ✭ 11 (-80.7%)
Mutual labels:  phoenix
easy podcasts
Agregador de podcasts y convertidor de audio para cubanos
Stars: ✭ 28 (-50.88%)
Mutual labels:  phoenix
petal components
Phoenix Live View Components
Stars: ✭ 138 (+142.11%)
Mutual labels:  phoenix
phoenix live controller
Controller-style abstraction for building multi-action live views on top of Phoenix.LiveView
Stars: ✭ 31 (-45.61%)
Mutual labels:  phoenix
curious messenger
Companion repository for Phoenix LiveView Messenger app by Curiosum.dev. Part 1: https://curiosum.dev/blog/elixir-phoenix-liveview-messenger-part-1?utm_source=github&utm_medium=social, Part 2: https://curiosum.dev/blog/elixir-phoenix-liveview-messenger-part-2?utm_source=github&utm_medium=social, Part 3: https://curiosum.dev/blog/elixir-phoenix-l…
Stars: ✭ 30 (-47.37%)
Mutual labels:  phoenix
phoenix bakery
Better compression for your Phoenix assets
Stars: ✭ 25 (-56.14%)
Mutual labels:  phoenix
accent
Dynamically convert the case of your JSON API keys
Stars: ✭ 27 (-52.63%)
Mutual labels:  phoenix
BearNecessities
Multiplayer bear game with Phoenix Live View
Stars: ✭ 19 (-66.67%)
Mutual labels:  phoenix

Tests Dependabot Status

LogViewer

An Web based Log Viewer for Elixir and Phoenix

Overview

Features

  • 🔍 Filtering logs with level and search word
  • Realtime Update
  • 🌈 Syntax Highlighted logs
  • Phoenix 1.3 & 1.4 supported

Imgur

Installation

mix.exs

def deps do
  [
    {:log_viewer, "~> 0.1.0", only: [:dev]}
  ]
end

Log Viewer is mainly focused on development purpose. So in production environment, please consider to using Log Management platform like AWS CloudWatch Logs, Papertrail and timber.

Configuration

Add {LogViewer.Logger, []} to your logger backends

config :logger,
  backends: [{LogViewer.Logger, []}, :console]

then start your application and open http://localhost:5900

$ ➜ iex -S mix
Erlang/OTP 21 [erts-10.1] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [hipe]

05:51:25.379 [info]  Log Viewer started listening on http://localhost:5900
Interactive Elixir (1.7.4) - press Ctrl+C to exit (type h() ENTER for help)

then output logs by Logger

iex> require Logger
iex> Logger.info("foo")
iex> Logger.debug("foo")
iex> Logger.warn("foo")
iex> Logger.error("foo")

Imgur

Usage

Phoenix Integration

Basically Log Viewer can works as standalone elixir app.

But you can also integrate Log Viewer with Phoenix as well.

  1. Add route for Log Viewer

router.ex

scope "/" do
  pipe_through(:browser)
  get("/", MyAppWeb.PageController, :index)
end

# Route for Log Viewer
forward("/log_viewer", LogViewer.Router)

Cowboy

Phoenix depends Cowboy HTTP server and Cowboy 2.0 had breaking change, so you must change configuration according to Phoenix and Cowboy version.

For Phoenix 1.3 users

endpoint.ex

socket("/log_viewer", LogViewer.PhoenixSocket)

❗️ This path MUST same with the path you defined in router.

For Phoenix 1.4 & Cowboy 1.0 users

This case is for if you have upgraded Phoenix 1.3 to 1.4 and still using cowboy 1.0

endpoint.ex

socket "/log_viewer", LogViewer.PhoenixSocket,
    websocket: true,
    longpoll: false

For Phoenix 1.4 & Cowboy 2.0 users

config/config.exs

Please CHANGE app name to your app name. (:my_app, MyAppWeb)

config :my_app, MyAppWeb.Endpoint,
  http: [
    dispatch: [
      {:_,
       [
         {"/log_viewer/websocket", LogViewer.WebSocketHandler, []},
         {:_, Phoenix.Endpoint.Cowboy2Handler, {MyAppWeb.Endpoint, []}}
       ]}
    ]
  ]

then start the phoenix and open http://localhost:4000/log_viewer in browser to view Log Viewer

Imgur

Standalone mode

If you are using phoenix integration and standalone server is not necessary, you can disable standalone server. Defaults to true.

config/config.exs

config :log_viewer, standalone: false

Standalone server port

If you want to change standalone server port. Defaults to 5900.

config/config.exs

config :log_viewer, port: 4002

Log Level

You can set log level. Defaults to :all.

This config results to only info level log

config/config.exs

config :log_viewer, level: :info

Tips

Use inspect/2 with pretty: true option will outputs pretty-printed logs

self() |> Process.info() |> inspect(pretty: true) |> Logger.info()

Imgur

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Test

  1. Clone this repo
  2. mix deps.get && iex -S mix
  3. Open another window to run nuxt.js
  4. cd src && npm install && npm run dev

TODO

  • Log Persistence
  • Configurable Syntax Highlight theme
  • Performance Improvement

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].