1

I am creating a command based application, and need to setup logging for the project. Previously, I have only used the logging provided by Play framework and the configurations were already set. But since I need to setup logging for this project, how do we do so?

I decided to use Scala Logging 2.1.2, but checking on the github page there isn't any tutorial explaining how to set it up.

So, can you provide me with links to tutorials or examples, which explains the process of setting up logging for a scala project. Thank you, any help is appreciated.

1 Answer 1

1

Just stick to the JVM "standard": http://www.slf4j.org/

You can use whichever implementation you prefer, either logback or log4j.

By the way, this is what Play uses under the hood, so you should be able to re-use most of what you learnt on your previous project.

Sign up to request clarification or add additional context in comments.

4 Comments

Yes, its actually a Scala wrapper for slf4j, so the configuring part is similar for java and scala both??, its the configuring part that I am having trouble with.
The slf4j documentation is very complete and provides a lot of examples. We can't spit out your configuration since we don't know what you want to do with your logging :)
Umm, thank you I will check out the docs, I haven't ever setup a logging mod so, didn't know what to expect for scala, I will look for the docs in slfj.
If you're happy with the default logging config in Play, you'll find the config file in the main Play jarfile, named /logger.xml. It uses a property application.home set by Play, so you'll have to provide/change that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.