Git Product home page Git Product logo

log-viewer's Introduction

LogViewer

LogViewer is a Web application for monitoring server logs in real-time in the browser.

The tool provides powerful UI with highlighting, filtering, search, folding inconsiderable text. Merging several logs into one view works as well.

LogViewer can show huge log files without significant resource consumption because it reads only the part of the file that a user is watching. No indexing.

Screenshot

Features

  1. Highlighting fields, lines, parent brackets. Highlighting makes the log much more readable.
  2. Event filtering by a level, logger, date, thread, etc... Filtering by a custom condition written on JavaScript is available as well. more details
  3. Merging events from several log files and showing its as one log. If log files are located on different machines, all machines must have run LogViewer.
  4. Folding secondary information like unmeaning parts of exception stacktraces, full name of logger.
  5. Detecting the format of the log file.
  6. A permanent link to a log position. A user can copy a link to the current position and send it to another user.

Demo video

Quick start

  • Download LogViewer from Github releases and unpack it to any folder. Make sure the machine has installed Java 8 or later.
  • Run log-viewer-1.0.10/logviewer.sh
  • Open http://localhost:8111. There will be a file chooser to select a log from the file system.

User can open a log file using the file chooser on http://localhost:8111 or by a direct link: http://localhost:8111/log?log=$pathToLogFile. For opening several log files in one view, pass several "log" query parameters, for example: http://localhost:8111/log?log=$pathToLogFile1&log=$pathToLogFile2&log=$pathToLogFile3
Note: all log files must have full timestamp, otherwise LogViewer cannot merge them.

Also, LogViewer can be embedded into another java web application, if you don't want to run it as a standalone process. See embedding to Spring Boot application or embedding to java web application

Configuration

Configuration is located in log-viewer-1.0.10/config.conf, the file has HOCON format.

The most important configuration is a list of available files. Also, you can specify the log format if the automatic format detection works incorrectly; shortcuts for files/file sets, etc...

More details about configuration

Performance

The idea to filter logs without indexing sounds questionable. If the filter settings filter out all elements, the system has to scan the entire file to make sure that no visible events exist. Also, each search can perform a full scan of the log. Actually, the full scan is not a big problem, the parser works fast enough. Parsing 1Gb file takes 3,5 sec on my machine. It is viable.
Setting a date range filter can speed up the tool a lot because only events from the specified date range will be considered.

log-viewer's People

Contributors

dependabot[bot] avatar dima-bzz avatar izeye avatar psharma-incomm avatar sevdokimov avatar zuevkirill95 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

log-viewer's Issues

Filter for log list dropdown

When several log files are opened in one view, there is a dropdown with the list of files.

Screenshot from 2021-03-30 17-18-07

The filter by filename is needed. There may be a big number of files.

Read logs from stdin

We are running Wildfly (or JBoss) server in a docker container. We want to see the outputs of the Wildfly process in log-viewer. Unfortunately, we can't output the server logs to a file (because the underlying pods has a very limited disc space). So, the idea is to show the stdout of the Wildfly process on log-viewer, like:

./start-wildfly | logviewer.sh

There is a node based implementation called frontail that allow this.
Is there a way to do this with log-viewer. We tried using /dev/stdin without success.

mvn clean install

When I'm doing a clean install I get some issues during the tests

Tests in error:
  testCustomParamParser(com.logviewer.CustomPathResolverTest): Illegal char <:> at index 2: /C:/j/w/i

If I skip the tests, the build is in success but I can see theses errors in the logs:

[ERROR]
[INFO] chunk {1} main.5488f838233165ac8a9e.js (main) 2.23 MB [initial] [rendered]
[INFO] chunk {2} polyfills.2525ecc154fd6d28c69e.js (polyfills) 44 kB [initial] [rendered]
[ERROR] WARNING in C:\j\w\i\laboratory\log-viewer\log-viewer-frontend\src\environments\environment.prod.ts is part of the TypeScript compilation but it's unused.
[ERROR] Add only entry points to the 'files' or 'include' properties in your tsconfig.
[ERROR]
[ERROR] WARNING in C:\j\w\i\laboratory\log-viewer\log-viewer-frontend\src\app\log-view\log-view.component.ts depends on 'jquery'. CommonJS or AMD dependencies can cause optimization bailouts.
[ERROR] For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
[INFO] chunk {3} polyfills-es5.196f9a5806ab9df79eec.js (polyfills-es5) 127 kB [initial] [rendered]
[ERROR]
[ERROR] WARNING in C:\j\w\i\laboratory\log-viewer\log-viewer-frontend\src\app\utils\ace-editor.directive.ts depends on 'brace/mode/javascript'. CommonJS or AMD dependencies can cause optimization bailouts.
[ERROR] For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

I'm running this on Windows 10.

Failed to read log

Hi @sevdokimov,

I am using logback with specific format like this %d{yyyy-MM-dd HH:mm:ss, Asia/Seoul} %-10level [%L] [%.-24thread] %logger{50} %ex{30} - %msg%n but it does not work. It throws an error File content cannot be parsed using the specified log format.

Is there any way to solve it?

image

Merge logs with RegexLogFormat

I have next configuration:
logs = [
{
path: ${HOME}"/var/log/mymodule/*.log"
format: {
type: RegexLogFormat
regex: "(?<date>\d{4}-\w{3}-\d{2} \d{2}:\d{2}:\d{2}.\d{6}) +(?<level>[A-Z]+) +(?<msg>.+)"
charset: UTF-8
fields: [
{ name: "date", type: "date" },
{ name: "level", type: "level" },
{ name: "msg", type: "message" }
]
}
}
]

Directory ${HOME}/mymodule/ contains two files: 1.log and 2.log
Example of logs messages:
2021-May-28 15:46:13.461889 DEBUG [my_app.cpp]:190 transactions=0
2021-May-28 15:46:13.462011 INFO [my_app.cpp]:209 Loading configuration file

When I try to access log, I see next form:

host: demo
file: /var/log/mymodule/1.log 889 bytes, 2021-05-28 15:46:14
timestamp: N/A
offset: 0
Fields
date 2021-May-28 15:46:13.461889
level DEBUG
msg [my_app.cpp]:190 transactions=0

But when I try to merge 1.log and 2.log:
Failed to read log
/var/log/mymodule/1.log | (No date field, log cannot be merged)
/var/log/mymodule/2.log | (No date field, log cannot be merged)

How fix it?

Cannot load configuration with log format type Log4jLogFormat

When trying to start logviewer with Log4jLogFormat specified as log type in the config file I'm getting the below exception.
The exception is not thrown when I use the LogbackLogFormat.

Is this because the Log4jLogFormat class is not specified in LoggerLibSupport.java (there's null instead)?

public class LoggerLibSupport {

    private static final LoggerLibSupport[] LIB_SUPPORTS = {
            // Logback
            new LoggerLibSupport("logback",
                    "ch.qos.logback.classic.LoggerContext",
                    "com.logviewer.logLibs.logback.LogbackConfigImporter",
                    "com.logviewer.logLibs.logback.LogbackLogFormat"),

            new LoggerLibSupport("log4j",
                    "org.apache.logging.log4j.core.LoggerContext",
                    "com.logviewer.logLibs.log4j.Log4jConfigImporter",
                    null)
    };

The exception:

2021-06-05_09:45:05.756 [main] WARN  o.s.c.a.AnnotationConfigApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'lvLogService': Unsatisfied dependency expressed through field 'accessManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logManager' defined in com.logviewer.LvStandaloneConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.logviewer.services.LvFileAccessManagerImpl]: Factory method 'logManager' threw exception; nested exception is java.lang.IllegalArgumentException: Invalid configuration [line=13]: failed to load the log format
Exception in thread "main" org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'lvLogService': Unsatisfied dependency expressed through field 'accessManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logManager' defined in com.logviewer.LvStandaloneConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.logviewer.services.LvFileAccessManagerImpl]: Factory method 'logManager' threw exception; nested exception is java.lang.IllegalArgumentException: Invalid configuration [line=13]: failed to load the log format
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:586)
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:372)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1329)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:572)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:881)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
        at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:88)
        at com.logviewer.LogViewerMain.startup(LogViewerMain.java:70)
        at com.logviewer.LogViewerMain.main(LogViewerMain.java:234)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logManager' defined in com.logviewer.LvStandaloneConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.logviewer.services.LvFileAccessManagerImpl]: Factory method 'logManager' threw exception; nested exception is java.lang.IllegalArgumentException: Invalid configuration [line=13]: failed to load the log format
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:591)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1245)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:535)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1131)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1058)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:583)
        ... 15 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.logviewer.services.LvFileAccessManagerImpl]: Factory method 'logManager' threw exception; nested exception is java.lang.IllegalArgumentException: Invalid configuration [line=13]: failed to load the log format
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:583)
        ... 27 more
Caused by: java.lang.IllegalArgumentException: Invalid configuration [line=13]: failed to load the log format
        at com.logviewer.impl.LvPatternFormatRecognizer.fromHocon(LvPatternFormatRecognizer.java:64)
        at com.logviewer.LvStandaloneConfig.logManager(LvStandaloneConfig.java:36)
        at com.logviewer.LvStandaloneConfig$$EnhancerBySpringCGLIB$$789ef1e2.CGLIB$logManager$0(<generated>)
        at com.logviewer.LvStandaloneConfig$$EnhancerBySpringCGLIB$$789ef1e2$$FastClassBySpringCGLIB$$5cdab08.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:365)
        at com.logviewer.LvStandaloneConfig$$EnhancerBySpringCGLIB$$789ef1e2.logManager(<generated>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
        ... 28 more
Caused by: com.google.gson.JsonParseException: cannot deserialize interface com.logviewer.data2.LogFormat subtype named Log4jLogFormat; did you forget to register a subtype?
        at com.google.gson.typeadapters.RuntimeTypeAdapterFactory$1.read(RuntimeTypeAdapterFactory.java:193)
        at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:199)
        at com.google.gson.Gson.fromJson(Gson.java:803)
        at com.google.gson.Gson.fromJson(Gson.java:768)
        at com.google.gson.Gson.fromJson(Gson.java:717)
        at com.google.gson.Gson.fromJson(Gson.java:689)
        at com.logviewer.impl.LvPatternFormatRecognizer.fromHocon(LvPatternFormatRecognizer.java:62)
        ... 39 more

My config file (the relevant part):

// List of file patterns describing visible files and subdirectories
logs = [
  {
    path: "/logs/**/*.log"  // All files with ".log" extension are visible by default
    format = {
      type: Log4jLogFormat
      pattern: "%date{ISO8601} %-5p %t %c{4}:%L - %m%n"
    }
  }
]

json/jsonl log format support

Hello,

is it possible to view *.jsonl files? The idea of config file:

format = {
  type: JsonFormat
  charset: UTF-8
  fields: [
    { name: "date", type: "date" },
    { name: "log.level", type: "level/log4j" },
    { name: "server.ip", type: "message" },
    { name: "message", type: "message" },
  ]
}

Thank you.

Fanda

An example:

{"@timestamp":"2021-09-06T07:51:35.894+02:00","message":" 60aa634568a31c4442f2feb29779752e SELECT ID FROM logins WHERE LOGIN = 'xy'","log":{"level":"debug"},"server":{"ip":"172.23.0.2"},"http":{"request":{"method":"POST"}},"trace":{"id":"no-session-lZK"},"user":{"id":-1}}
{"@timestamp":"2021-09-06T07:51:35.894+02:00","message":" 60aa634568a31c4442f2feb29779752e SELECT ID FROM logins WHERE LOGIN = 'xy'","log":{"level":"debug"},"server":{"ip":"172.23.0.2"},"http":{"request":{"method":"POST"}},"trace":{"id":"no-session-lZK"},"user":{"id":-1}}
{"@timestamp":"2021-09-06T07:51:35.894+02:00","message":" 60aa634568a31c4442f2feb29779752e SELECT ID FROM logins WHERE LOGIN = 'xy'","log":{"level":"debug"},"server":{"ip":"172.23.0.2"},"http":{"request":{"method":"POST"}},"trace":{"id":"no-session-lZK"},"user":{"id":-1}}

Cretae a docker image and make it available in docker hub

I use docker-compose to setup applications, and it would be great if I could use logviewer as an independent container. I would be happy to help to setup this feature.

The pom.xml example bellow is from my open source project showing how to use google jib plugin: https://github.com/GoogleContainerTools/jib/tree/master/jib-maven-plugin

Apps running in a docker container only have access to the files of the host system through shared volumes. This means that browse-and-select log files feature will not work. Instead the logviewer should scan a specific directory (e.g. /app/externalLogs/) and expose this to the hosts (see <volumes> section). When I build my docker-compose project I configure my apps to share the logs with the hosts in a single directory, which means I can configure logviewer container to access that single directory through its shared volume.

          <plugin>
            <groupId>com.google.cloud.tools</groupId>
            <artifactId>jib-maven-plugin</artifactId>
            <configuration>
              <from>
                <image>openjdk:8</image>
              </from>
              <to>
                <image>cristalise/development:${revision}</image>
              </to>
              <container>
                <creationTime>${maven.build.timestamp}</creationTime>
                <environment>
                  <APP_NAME>${project.artifactId}</APP_NAME>
                </environment>
                <jvmFlags>
                  <jvmFlag>-Dlogback.configurationFile=/app/config/logback.xml</jvmFlag>
                  <jvmFlag>-DAPP_NAME=${project.artifactId}</jvmFlag>
                  <jvmFlag>-Xms1024m</jvmFlag>
                  <jvmFlag>-Xdebug</jvmFlag>
                </jvmFlags>
                <mainClass>org.cristalise.kernel.process.StandardServer</mainClass>
                <args>
                  <arg>-config</arg>
                  <arg>/app/config/server.conf</arg>
                  <arg>-connect</arg>
                  <arg>/app/config/local.clc</arg>
                  <arg>-Shiro.iniFile</arg>
                  <arg>/app/config/shiro.ini</arg>
                </args>
                <ports>
                  <port>7000</port>
                </ports>
                <volumes>
                  <volume>/app/config</volume>
                  <volume>/app/log</volume>
                </volumes>
              </container>
            </configuration>
          </plugin>

download log file

Is there a option to download the file log?
would be very interesting to download de full log file sometimes... and also if the file is already compressed (.gz, .zip)...

Не корректная отработка формата времени

Приветствую!
v0.1.5
При формате даты с точностью секунды более трех знаков после запятой "зависает" при попытке пролистывании страницы.
Формат:
logs = [
{
path: "**/*.log"
format: {
type: LogbackLogFormat
pattern: "%date{yyyy-MM-dd HH:mm:ss.SSSS} %msg"
}
}

lgw

example.log

Action "Go to date"

The menu should contain "Go to date..." item. When a user clicks on it, the dialog to choose a date will be opened. After choosing a date, the log will be opened at the position closest to the date.

auto reload to end of file (tail)

is there a option to automatically update to end of file after it have add new entries to the log?

maybe I doing something wrong. But would be a very nice improvement auto reload to the end option (like tail)...

Custom log file not display

Thanks very much for your nice work.

How can I add custom path log file ?

I tried this but my custom log file not shown:

        @Bean
	public Map<Path, LogFormat> getLogConfigurations() {
		File f = new File("./info/logs/errors/fileError.log");
		LogbackLogFormat logbackLogFormat = new LogbackLogFormat("%date %level [%thread] [%file:%line] %msg%n");
		
		Map<Path, LogFormat> logs = new HashedMap();
		logs.put(f.toPath(), logbackLogFormat);
		
		return logs;
	}

the default spring log its shown my custom log not

viewer

hello.
i can see the entire log with logviewer.sh.
but,springboot can't.

No date field error when log entry has to many rows

Some of my logs contain stacktraces as long as 65 rows. When this happen in a logfile, log-viewer cannot correctly identify the next log entry. It returns a No date field, log cannot be merged error. When I remove the log entries in the log it returns to function correctly. I assume this is due to a maximum number of rows an entry is allowed to take. Maybe an option to add this as a config variable to set?

Example:

2022-01-19 14:41:44,459 DEBUG { } http-nio-XXX-7070-exec-9 [XXX.DefaultTokenService]: Fout bij verifieren token.
java.security.SignatureException: token expired at X, now is 202X44.459Z
at net.oauth.jsontoken.JsonTokenParser.verifyAndDeserialize(JsonTokenParser.java:132) ~[jsontoken-1.0.jar!/:?]
..... 63 rows
2022-01-19 14:41:44,461 ERROR { } X [XTokenRestController]: Foutcode: X

Thanks, and I like your tool!

Getting null pointer exception after few days of usage with the log-viewer.

java.lang.NullPointerException
at com.logviewer.data2.Position.equals(Position.java:60)
at java.util.Objects.equals(Objects.java:59)
at com.logviewer.web.session.LogSession.loadNext(LogSession.java:329)
at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.logviewer.web.rmt.RemoteInvoker.call(RemoteInvoker.java:59)
at com.logviewer.web.WebsocketEmulationController$ConnectionSession.processRequestsInQueue(WebsocketEmulationController.java:229)
at com.logviewer.web.WebsocketEmulationController$ConnectionSession.handleRequest(WebsocketEmulationController.java:149)
at com.logviewer.web.WebsocketEmulationController.request(WebsocketEmulationController.java:90)
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.logviewer.web.AbstractRestRequestHandler.process(AbstractRestRequestHandler.java:145)
at com.logviewer.web.AbstractRestRequestHandler.process(AbstractRestRequestHandler.java:63)
at com.logviewer.web.LogViewerServlet.doPost(LogViewerServlet.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:567)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1435)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1350)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:516)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:383)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:882)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1036)
at java.lang.Thread.run(Thread.java:748)

dark background

suggestion.
the current background is very good.
it would be really cool just another dark one.

Saving/Loading filter state

A user should be able to save filter panel state and load it then.
Filter panel state may be saved to the browser's local storage.

Log refresh?

The log file showed on the server is not refreshing... how can a refresh de log content?

SpringBoot configuration

Trying to use the springboot configuration:
I've added your configuration file to the scan:
image

I get this error:

2021-05-31 13:53:38.022 ERROR 12408 --- [  restartedMain] o.s.boot.SpringApplication               : Application startup failed

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.wallride.bootstrap.Bootstrap]; nested exception is java.io.FileNotFoundException: class path resource [com/logviewer/springboot/LogViewerSpringBootConfig.class] cannot be opened because it does not exist

image

If I simply copy your configuration file in a local file:
image
It doesn't found your autoconfiguration or servlet from your library.

Am I missing something?

Thanks in advance

context path in config file

a great and useful improvement would be a property in config file to set the context path. look the picture below.

Image 2021-06-08 at 14 57 40

Unusable on mobile devices - cannot scroll

Is there a way to make this work on mobile devices?
I tried using safari, chrome and edge on iPhone and iPad and there is no way to scroll.
We can just see the content of the screen but swiping up or down does not scroll the content.

It would be great if this could be fixed, otherwise it cannot be used on mobile devices.

Reverse proxy with nginx

Hi,
I am trying to deploy this utility at cloud behind nginx server.
I am not able to set its homepage.
Like https://somehost/logs/
so that Js and css could load with the relative path, not with the root.

IllegalStateException: Cannot load configuration class: com.logviewer.LvStandaloneConfig when launching the viewer

Hi, I'm getting the following exception when trying to run the log-viewer from inside an openjdk:latest container:

Exception in thread "main" java.lang.IllegalStateException: Cannot load configuration class: com.logviewer.LvStandaloneConfig
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:414)
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:254)
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:282)
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:126)
        at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:533)
        at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:88)
        at com.logviewer.LogViewerMain.startup(LogViewerMain.java:70)
        at com.logviewer.LogViewerMain.main(LogViewerMain.java:234)
Caused by: java.lang.ExceptionInInitializerError
        at org.springframework.context.annotation.ConfigurationClassEnhancer.newEnhancer(ConfigurationClassEnhancer.java:122)
        at org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:110)
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:403)
        ... 8 more
Caused by: org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @20f5239f
        at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:464)
        at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:336)
        at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:93)
        at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:91)
        at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61)
        at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34)
        at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:116)
        at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:291)
        at org.springframework.cglib.core.KeyFactory$Generator.create(KeyFactory.java:221)
        at org.springframework.cglib.core.KeyFactory.create(KeyFactory.java:174)
        at org.springframework.cglib.core.KeyFactory.create(KeyFactory.java:153)
        at org.springframework.cglib.proxy.Enhancer.<clinit>(Enhancer.java:73)
        ... 11 more
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @20f5239f
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
        at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
        at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
        at org.springframework.cglib.core.ReflectUtils$1.run(ReflectUtils.java:61)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:554)
        at org.springframework.cglib.core.ReflectUtils.<clinit>(ReflectUtils.java:52)
        at org.springframework.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:243)
        at org.springframework.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
        at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:329)
        ... 23 more

Steps to reproduce:

  1. Create a new container from openjdk:latest
  2. Login into the container command line
  3. unzip the log-viewer-0.1.6.zip there
  4. try to start the log-viewer

Log not showing up

I tried opening a log file and it is not showing up. I than defined a regex based log format but it still came up empty. How do debug?

Shortcuts

I can not get shortcuts to be recognized.

I have this value in log-paths

DropIt = {
file = "C:/HTPC/DropIt/LogFile.log"
}

But it doesn't find the file.

LogViewer Autoconfiguration class is missing in current version

The following exception occurs when the current version (0.1.8 and 0.1.7) is integrated with Spring Boot 2.4.6 after following the guide in SB and demo application in the repo.

Exception:
Caused by: java.io.FileNotFoundException: class path resource [com/logviewer/config/LogViewerAutoConfig.class] cannot be opened because it does not exist

Load log from sub-directory

Hi, is there any way that allows defining multiple dir by using log-viewer.default-directory or auto-detect log from sub-directory?

Deploy to maven central

Hello,
Can you deploy to maven central, I have 401 Unauthorized sometimes, I need to re-run maven couple of times to be abled to download the artifacts.
And it is difficult to make it works in ci pipeline.

Thanks

Smart renderer for URLs with query parameters

Let's imagine log contains URL with a lot of parameters, some parameters are encoded

http://zabbix-prod-01.aws.internal/tr_status.php?fullscreen=0&groupid=0&hostid=0&show_triggers=1&ack_status=2&show_events=1&show_severity=2&txt_select=%D1%8B%D1%8B%D1%8B&application=&inventory%5B0%5D%5Bfield%5D=type&inventory%5B0%5D%5Bvalue%5D=&show_maintenance=1&filter_set=1

It's not convenient to find a parameter by name. If the value is encoded user has to copy it and decode it in external tools.
It would be good if a user can click on "?" symbol in the URL and see the table containing parameters and values in a popup.

Implementation

This can be done by implementing TextRenderer interface (src/main/frontend/src/app/log-view/renderers/renderer.ts)

Wrap around search when limit of log is reached

Usually, most document searches wrap around when you hit the lower or upper end of the file. Like you're searching for something and they don't stop and ask you to use other shortcut to go back on your search.

Add colors for different levels

I am using the following config:

format = {
  type: RegexLogFormat
  regex: "(?<date>\\d\\d:\\d\\d:\\d\\d\\.\\d{3}) - +(?<level>[A-Z]+)\\s+- (?<msg>.+)"
  fields: [
    { name: "date", type: "date" },
    { name: "level", type: "level/log4j" },
    { name: "msg", type: "message" },
  ]
}

I see that the ERROR level is highlighted in red, and INFO is in green, however I would like my DEBUG to be in another color (one that I choose - is this possible?

Also how could I get the entire message highlighted in red and the text in white for ERROR messages?

Thanks for a very promising product I will be watching this closely.

Dynamic Logs

Thanks very much for your nice work.

Please how can I use it for dynamic log files for Spring Log Viewer ?

I tried make the bean as prototype not singleton but also not work, its run it only first time and not call it when call /logs

@Bean
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public LogConfigurationLoader customConfigLoader() {
...
}

please please is there any way to update the logs dynamically ?, even use Reflection or update it manually, please any way that work, and thanks very much in advance and for your nice work

bug when searching backwards for word

This error occurs when searching backwards for a given term. It's deterministic, it always happens when reaching the line starting with "2021-03-25 07:02:04.456 INFO 123695 ". The problem appears to be caused due to the overlapping time range of the new retrieved records with the current ones.

The assertion below is triggered.

// file: record-renderer.service.ts
if (end < m.length) {
    SlUtils.assert(Record.compareTo(m[end - 1], m[end]) < 0);
}

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.