I'm trying to log to a file in a simple app

classic Classic list List threaded Threaded
7 messages Options
tom
Reply | Threaded
Open this post in threaded view
|

I'm trying to log to a file in a simple app

tom
 I'm not able to log to a file.  Here's a snippet of my Ratpack.groovy file:

 import groovy.util.logging.Slf4j

@Slf4j
 ratpack {
    handlers {

Any one know why this isn't working?
rus
Reply | Threaded
Open this post in threaded view
|

Re: I'm trying to log to a file in a simple app

rus
I'm afraid you can't use that annotation on the ratpack closure, see https://github.com/ratpack/ratpack/issues/373.

You should still be able to log in the normal way using

final Logger log = LoggerFactory.getLogger(Ratpack.class);
ratpack {
    handlers {
tom
Reply | Threaded
Open this post in threaded view
|

Re: I'm trying to log to a file in a simple app

tom
He thanks a lot for the tip.  I added that and there are no errors but I can't find the log file.  Any ideas on where it might be?

Thanks
rus
Reply | Threaded
Open this post in threaded view
|

Re: I'm trying to log to a file in a simple app

rus
What path did you use in your configuration?  If it was just a relative one then it will be in src/ratpack I think.
tom
Reply | Threaded
Open this post in threaded view
|

Re: I'm trying to log to a file in a simple app

tom
I looked there and didn't see it.  How would I configure it?  I didn't see anything in the docs about configuring logging.  
rus
Reply | Threaded
Open this post in threaded view
|

Re: I'm trying to log to a file in a simple app

rus

If you've used the lazybones template then only the slf4j simple logger impl is used and log will only go to the console.

The best place to look is in the example-books project where there is an example of log4j2 async.  You need to look in build.gradle and src/main/resources

On 7 Aug 2014 17:09, "tom [via Ratpack Forum]" <[hidden email]> wrote:
I looked there and didn't see it.  How would I configure it?  I didn't see anything in the docs about configuring logging.  


If you reply to this email, your message will be added to the discussion below:
http://forum.ratpack.io/I-m-trying-to-log-to-a-file-in-a-simple-app-tp598p602.html
To start a new topic under Ratpack Forum, email [hidden email]
To unsubscribe from Ratpack Forum, click here.
NAML
tom
Reply | Threaded
Open this post in threaded view
|

Re: I'm trying to log to a file in a simple app

tom
ok thanks