How do i found the vertx.log file on linux

1,959 views
Skip to first unread message

mubbashar husain

unread,
May 13, 2014, 1:34:00 AM5/13/14
to ve...@googlegroups.com
Hi All,

I am not able to find the vertx.log file. Can you please tell where can i found it. 
Or let me know how do i configure the path for it

thanks!

mubbashar husain

unread,
May 13, 2014, 1:41:13 AM5/13/14
to ve...@googlegroups.com
getting null on printing this System.getProperty(" java.io.tmpdir");

Alexander Lehmann

unread,
May 13, 2014, 6:31:47 AM5/13/14
to ve...@googlegroups.com
usually the log file will end up in the TMP dir, which should be set to /tmp, if it isn't I'm not sure. You could try to run your vert.x programs with export TMP=/tmp, maybe that will put the log file into the right place.

Alexander Lehmann

unread,
May 13, 2014, 6:33:35 AM5/13/14
to ve...@googlegroups.com
Sorry, forgot to ask, on what system are you on?

If you are Windows, the default tmp dir is \users\yourname\AppData\Local\Temp

On linux it should be in fact /tmp, on MacOS, I have no idea.


mubbashar husain

unread,
May 14, 2014, 1:10:03 AM5/14/14
to ve...@googlegroups.com
I am on linux centos. but i am not able to find it under /tmp or /var/tmp directory


On Tuesday, 13 May 2014 10:34:00 UTC+5, mubbashar husain wrote:

Norman Maurer

unread,
May 14, 2014, 1:14:11 AM5/14/14
to ve...@googlegroups.com, mubbashar husain
Just specify -Djava.io.tmpdir=/var/tmp/ in the vertx start script. Quite strange that it seems to be not set already.

-- 
Norman Maurer
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mubbashar husain

unread,
May 14, 2014, 1:22:25 AM5/14/14
to ve...@googlegroups.com
thanks it worked :)
but in the vertx.log file i am seeing this

[main] 2014-05-14T05:07:37.768Z INFO [org.vertx.java.platform.impl.cli.Starter]      vertx run <main> [-options]                                                
        runs a verticle called <main> in its own instance of vert.x.           
        <main> can be a JavaScript script, a Ruby script, A Groovy script,     
        a Java class, a Java source file, or a Python Script.

    valid options are:

blah blah blah ......................

although the vertx is running. it should have the log of my logger. isn't it ?

On Tuesday, 13 May 2014 10:34:00 UTC+5, mubbashar husain wrote:

Alexander Lehmann

unread,
May 14, 2014, 7:45:56 AM5/14/14
to ve...@googlegroups.com
could you do a env >env.txt
and put that into a paste-url somewhere (e.g. paste2.org) so that we can check what the environment contains, maybe this is reproducible.

I can only say it worked for me on ubuntu, haven't used another Linux for vert.x yet.
Message has been deleted

Alexander Lehmann

unread,
May 14, 2014, 6:10:44 PM5/14/14
to ve...@googlegroups.com
Ok, looking at your example (checked with Ubuntu, but it should be the same on centos), the temp path is in fact set (as Norman pointed out, you can set that. If you don't, its /tmp) and it is not dependent or affected by any environment variable (at least in Linux). So if you just call a vertx program, its always /tmp.

You will always find the logs in /tmp/vertx.log, however there is one thing important to consider, the file is always written new, it is not appended. This means that you will get only the last log output when you run more than one vertx program.This is probably the reason why you do not find your expected log in the file if you have started something else.

If you need the output from different invocations of vertx, you have to modify the logging properties to create a new file for each invocation or use a different logging framework that appends the logs differently.

Atom Cong

unread,
Feb 20, 2015, 3:20:00 AM2/20/15
to ve...@googlegroups.com, mubba...@gmail.com, norman...@googlemail.com
I am using vert.x 2.1.5, and have the same issue. 

I set this flag, but still cannot find anything under /var/tmp.  Anything else I should double check?

Alexander Lehmann

unread,
Feb 20, 2015, 6:35:13 AM2/20/15
to ve...@googlegroups.com, mubba...@gmail.com, norman...@googlemail.com
what system are you on (linux, windows, mac)?

Atom Cong

unread,
Feb 20, 2015, 11:49:59 PM2/20/15
to ve...@googlegroups.com, mubba...@gmail.com, norman...@googlemail.com
I am on ubuntu 14.04. 

Atom Cong

unread,
Feb 21, 2015, 12:03:45 AM2/21/15
to ve...@googlegroups.com, mubba...@gmail.com, norman...@googlemail.com
after looking into  service messages more closely, I did saw somthing like this:

com.hotatom.SetupTest > testDatasource STANDARD_ERROR
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.


maybe it is indeed something wrong with the log class.  Let me see there are already solution online.  But really I didn't change anything from vert.x release package. 

On Friday, February 20, 2015 at 3:35:13 AM UTC-8, Alexander Lehmann wrote:

Jez P

unread,
Feb 21, 2015, 2:26:38 AM2/21/15
to ve...@googlegroups.com, mubba...@gmail.com, norman...@googlemail.com
Are the slf4j classes on your classpath? I'm not sure they're in the release package.

Jez P

unread,
Feb 21, 2015, 2:27:38 AM2/21/15
to ve...@googlegroups.com, mubba...@gmail.com, norman...@googlemail.com
From http://vertx.io/api/java/org/vertx/java/core/logging/Logger.html

"You will need to ensure whatever jar files required by your favourite log framework are on your classpath."


On Saturday, February 21, 2015 at 5:03:45 AM UTC, Atom Cong wrote:

Alexander Lehmann

unread,
Feb 21, 2015, 5:28:35 AM2/21/15
to ve...@googlegroups.com, mubba...@gmail.com, norman...@googlemail.com
Are you using the slf4j classes directly?

In that case, you have to add slf4japi and one logging impl to the maven dependencies and configure it accordingly (e.g. slf4jsimple or logback)

vert.x internally uses a log delegate class that is using JUL by default, this log will show up in $TMP/vertx.log

Atom Cong

unread,
Feb 22, 2015, 1:13:16 AM2/22/15
to ve...@googlegroups.com, mubba...@gmail.com, norman...@googlemail.com
I have done following things: 

1) in file logging.properties, I set : java.util.logging.FileHandler.pattern=/tmp/vertx.log
2) add two jars in gradle build file: 

         compile 'org.slf4j:slf4j-api:1.7.10'
         compile 'org.slf4j:slf4j-simple:1.7.10'
 
3) clean and rebuild everything

But still don't see the log file under /tmp/;  but looks like the error msg I previously mentioned is gone. 

Also in my java code, what I did to log is like this: 

     Logger logger = container.logger();
    logger.info("First log message");


Any other suggestions? 

Thank you very much! 

Tim Fox

unread,
Feb 22, 2015, 3:05:39 AM2/22/15
to ve...@googlegroups.com
On 13/05/14 06:41, mubbashar husain wrote:
getting null on printing this System.getProperty(" java.io.tmpdir");

You have a space between the first " and the java. Try removing that.


On Tuesday, 13 May 2014 10:34:00 UTC+5, mubbashar husain wrote:
Hi All,

I am not able to find the vertx.log file. Can you please tell where can i found it. 
Or let me know how do i configure the path for it

thanks!
--

Tim Fox

unread,
Feb 22, 2015, 3:09:13 AM2/22/15
to ve...@googlegroups.com
Please push something to GitHub so someone can take a look. Otherwise we're just playing a game of 20 questions and it'll be another 20 before we get enough information to diagnose your issue ;)

Alexander Lehmann

unread,
Feb 22, 2015, 11:23:16 AM2/22/15
to ve...@googlegroups.com, mubba...@gmail.com, norman...@googlemail.com
You have to distinguish between vert.x internal logging and slf4j, depending on what you use in _your_ classes, the configuration is different. If you are using Maven 3.2, there are also some issues with slfj4 since that is used by Maven now, however I guess your problem comes from the location of the logging.properties files in the project (difficult to say without looking at the complete project).

If you can, please create a project as simple as possible that reproduces your issue and put that into github or bitbucket

Atom Cong

unread,
Feb 22, 2015, 1:01:30 PM2/22/15
to ve...@googlegroups.com, mubba...@gmail.com, norman...@googlemail.com
Thank you so much.  I was almost giving up getting log file. :-) 

I created a project on bitbucket:   https://bitbucket.org/ruoyunhuang/vertx-test-project      It is a minimum version with only one verticle java file. 

And also a snapshot of my logging.properties file: 

handlers=java.util.logging.ConsoleHandler,java.util.logging.FileHandler
java.util.logging.SimpleFormatter.format=%5$s %6$s\n
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
java.util.logging.ConsoleHandler.level=INFO
java.util.logging.FileHandler.level=INFO
java.util.logging.FileHandler.formatter=org.vertx.java.core.logging.impl.VertxLoggerFormatter
# Put the log in the system temporary directory
java.util.logging.FileHandler.pattern=/tmp/vertx.log
# java.util.logging.FileHandler.pattern=%t/vertx.log
.level=INFO
org.vertx.level=INFO
com.hazelcast.level=SEVERE
io.netty.util.internal.PlatformDependent.level=SEVERE

Jez P

unread,
Feb 22, 2015, 2:04:08 PM2/22/15
to ve...@googlegroups.com, mubba...@gmail.com, norman...@googlemail.com
Can we also be clear on how exactly to repeat the problem - how are you running the verticle/module (including any and all command line options).

Also where is your logging.properties file?

(Please add the above info to the readme for your project)

Thanks

Jez

Atom Cong

unread,
Feb 22, 2015, 10:29:53 PM2/22/15
to ve...@googlegroups.com, mubba...@gmail.com, norman...@googlemail.com
updated the project's README file.  See the details in it.

right now I am using logging.properties file under vertx home's conf/ folder.  Don't know whether have a overriding one in module folder.  If there is a way, please let me know maybe I can try that way instead. 

Thanks a lot! 

Alexander Lehmann

unread,
Feb 23, 2015, 6:52:11 AM2/23/15
to ve...@googlegroups.com, mubba...@gmail.com, norman...@googlemail.com
I think when you are using gradle or maven, the files in the vertx installation directory are not used (however I have to check how this works).

Atom Cong

unread,
Feb 24, 2015, 12:00:30 AM2/24/15
to ve...@googlegroups.com, mubba...@gmail.com, norman...@googlemail.com
oh, I see. good to know this. Can you point me to the place where the manual talks about this?  I haven't read anything about it yet. 

Alexander Lehmann

unread,
Feb 24, 2015, 6:41:07 AM2/24/15
to ve...@googlegroups.com, mubba...@gmail.com, norman...@googlemail.com
I think that is not in the manual explicitly, however the build section mentions it

http://vertx.io/gradle_dev.html#overriding-default-vertx-configuration

Atom Cong

unread,
Feb 24, 2015, 11:51:41 PM2/24/15
to ve...@googlegroups.com, mubba...@gmail.com, norman...@googlemail.com
tried overriding logging.properties file.  Still do not see log file under /tmp

I update the bitbucket project.   I followed the instruction in the document by putting log.properties file under src/main/platform_lib.  Actually the sample project template that I branched from also has folder src/main/resources/platform_lib.  So I just put log properties file under both folders, but it does not help. 

Tim Fox

unread,
Feb 25, 2015, 2:24:06 AM2/25/15
to ve...@googlegroups.com
You're running it with Gradle.

IIRC, Gradle itself overrides the logging which is out of Vertx's control. I think this has been discussed several times on the list before ;)

https://gradle.org/docs/current/userguide/logging.html might be of some help

Atom Cong

unread,
Feb 26, 2015, 1:45:23 AM2/26/15
to ve...@googlegroups.com
used '-d' option of gradle (which prints everything to screen), and then redirect it to /tmp.

Still don't know how to feed a logging.properties file, but at least it works now! 

thanks guys! 
...

Alexander Lehmann

unread,
Feb 26, 2015, 1:12:21 PM2/26/15
to ve...@googlegroups.com
You could try to use log4j instead of JUL, that should be easier to configure since Gradle will not interfere.

The logging delegate can be set with
-Dorg.vertx.logger-delegate-factory-class-name=org.vertx.java.core.logging.impl.Log4jLogDelegateFactory

that should be in GRADLE_OPTS probably.
Reply all
Reply to author
Forward
0 new messages