[2.0] logs from test

2,194 views
Skip to first unread message

Havoc Pennington

unread,
Jan 23, 2012, 9:22:18 AM1/23/12
to play-fr...@googlegroups.com
Hi,

This is undoubtedly a dumb question, but if I do "test" at the Play 2
sbt console, where do the logs show up?

If I do "run" then they are in logs/application.log

I have some Akka logging on the console during test, but Play logging
doesn't seem to show up.

Havoc

Guillaume Bort

unread,
Jan 23, 2012, 1:08:55 PM1/23/12
to play-fr...@googlegroups.com
The logger is disabled in test mode for now because it was causing an
huge PermGen space leak when running tests. But we are working to run
tests in a forked JVM so we will enable it again soon.

> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>

--
Guillaume Bort

Sean B

unread,
Mar 29, 2012, 9:59:43 PM3/29/12
to play-fr...@googlegroups.com
Any update to this thread?


On Monday, January 23, 2012 1:08:55 PM UTC-5, Guillaume Bort wrote:
The logger is disabled in test mode for now because it was causing an
huge PermGen space leak when running tests. But we are working to run
tests in a forked JVM so we will enable it again soon.

On Mon, Jan 23, 2012 at 3:22 PM, Havoc Pennington <h...@pobox.com> wrote:
> Hi,
>
> This is undoubtedly a dumb question, but if I do "test" at the Play 2
> sbt console, where do the logs show up?
>
> If I do "run" then they are in logs/application.log
>
> I have some Akka logging on the console during test, but Play logging
> doesn't seem to show up.
>
> Havoc
>
> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.

> To post to this group, send email to play-framework@googlegroups.com.
> To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.


> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>

--
Guillaume Bort

Alex Jarvis

unread,
Jun 24, 2012, 7:32:32 AM6/24/12
to play-fr...@googlegroups.com
Is there any update on this?

Thanks,
Alex

On Monday, 23 January 2012 18:08:55 UTC, Guillaume Bort wrote:
The logger is disabled in test mode for now because it was causing an
huge PermGen space leak when running tests. But we are working to run
tests in a forked JVM so we will enable it again soon.

On Mon, Jan 23, 2012 at 3:22 PM, Havoc Pennington <h...@pobox.com> wrote:
> Hi,
>
> This is undoubtedly a dumb question, but if I do "test" at the Play 2
> sbt console, where do the logs show up?
>
> If I do "run" then they are in logs/application.log
>
> I have some Akka logging on the console during test, but Play logging
> doesn't seem to show up.
>
> Havoc
>
> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.

> To post to this group, send email to play-framework@googlegroups.com.
> To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.


> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>

--
Guillaume Bort

Marc Siegel

unread,
Jun 26, 2012, 2:05:24 PM6/26/12
to play-fr...@googlegroups.com
Guillaume, any update on being able to log in tests? Is there an open bug we can look at for it?

-Marc

Keynan Pratt

unread,
Jul 16, 2012, 3:47:11 AM7/16/12
to play-fr...@googlegroups.com
......., well?

Rintcius Blok

unread,
Jul 25, 2012, 10:44:20 AM7/25/12
to play-fr...@googlegroups.com

Guillaume Bort

unread,
Jul 25, 2012, 8:30:31 PM7/25/12
to play-fr...@googlegroups.com
We will fix this once we will be able to fork JVM to run tests, and so
completely discard the giant PermGen memory leaks introduced by the
Java logging infrastructure.

On Wed, Jul 25, 2012 at 7:44 AM, Rintcius Blok <rint...@gmail.com> wrote:
> FYI, I implemented a quick workaround for this issue. See
> http://stackoverflow.com/questions/11597102/how-to-force-logger-debug-output-in-play-framework-specs2-tests/11634963
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/utm_DgH6c2QJ.
>
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.



--
Guillaume Bort, http://guillaume.bort.fr

Senthil Kumar

unread,
Jul 26, 2012, 1:44:14 AM7/26/12
to play-fr...@googlegroups.com
Hi all,
 
  I am new to scala forms and scala framework, i have some thing to be cleared, previously i m using play 1.0 with scala but now i have upgraded to play 2.0.2 there i am facing lot of problems

1.  What is the alternative for request.action i.e i need the action and method name of current page.

2. How to change the config variable
    In play 1.0 i used setConfig but in play 2.X there is no such property in configuration.

3. How to store cookie values is there any way other than withCookies in redirect(routes.user.create)

4. Whether flashing will work only in redirect
 

Rintcius Blok

unread,
Jul 28, 2012, 12:07:59 PM7/28/12
to play-fr...@googlegroups.com
I created this issue entry to be able to track the issue: https://play.lighthouseapp.com/projects/82401-play-20/tickets/626-reenable-logging-in-tests
Is it milestone 2.1?


On Thursday, July 26, 2012 1:30:31 AM UTC+1, Guillaume Bort wrote:
We will fix this once we will be able to fork JVM to run tests, and so
completely discard the giant PermGen memory leaks introduced by the
Java logging infrastructure.

On Wed, Jul 25, 2012 at 7:44 AM, Rintcius Blok wrote:
> FYI, I implemented a quick workaround for this issue. See
> http://stackoverflow.com/questions/11597102/how-to-force-logger-debug-output-in-play-framework-specs2-tests/11634963
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/utm_DgH6c2QJ.
>
> To post to this group, send email to play-framework@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framework+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.



--
Guillaume Bort, http://guillaume.bort.fr

On Thursday, July 26, 2012 1:30:31 AM UTC+1, Guillaume Bort wrote:
We will fix this once we will be able to fork JVM to run tests, and so
completely discard the giant PermGen memory leaks introduced by the
Java logging infrastructure.

On Wed, Jul 25, 2012 at 7:44 AM, Rintcius Blok wrote:
> FYI, I implemented a quick workaround for this issue. See
> http://stackoverflow.com/questions/11597102/how-to-force-logger-debug-output-in-play-framework-specs2-tests/11634963
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/utm_DgH6c2QJ.
>
> To post to this group, send email to play-framework@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framework+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.



--
Guillaume Bort, http://guillaume.bort.fr

On Thursday, July 26, 2012 1:30:31 AM UTC+1, Guillaume Bort wrote:
We will fix this once we will be able to fork JVM to run tests, and so
completely discard the giant PermGen memory leaks introduced by the
Java logging infrastructure.

On Wed, Jul 25, 2012 at 7:44 AM, Rintcius Blok wrote:
> FYI, I implemented a quick workaround for this issue. See
> http://stackoverflow.com/questions/11597102/how-to-force-logger-debug-output-in-play-framework-specs2-tests/11634963
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/utm_DgH6c2QJ.
>
> To post to this group, send email to play-framework@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framework+unsubscribe@googlegroups.com.

Senthil Kumar R.G.

unread,
Jul 30, 2012, 12:53:04 AM7/30/12
to play-fr...@googlegroups.com
Hi thanks for the reply,

I m using play 2.0.2 with scala..

To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/8CVg81zLivIJ.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.

Hua-Ying Ling

unread,
Sep 15, 2012, 10:45:48 AM9/15/12
to play-fr...@googlegroups.com
This is currently the top rated issue on StackOverflow so while we're waiting on this fix, is there an easy way to reenable logging?  I can work around the memory leaks and restart Play if I have to.  I've tried Rintcius's solution http://stackoverflow.com/questions/11597102/how-to-force-logger-debug-output-in-play-framework-specs2-tests but haven't been able to get it to work.

Thanks!
Hua-Ying

Sean Brady

unread,
Sep 15, 2012, 12:03:23 PM9/15/12
to <play-framework@googlegroups.com>
+1

On Sep 15, 2012, at 10:45 AM, Hua-Ying Ling <2huaying@gmail.com>
 wrote:

To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/4H-TID4ZeNkJ.

tmyymmt

unread,
Oct 1, 2012, 8:26:03 AM10/1/12
to play-fr...@googlegroups.com
+1

2012年9月16日日曜日 1時03分32秒 UTC+9 Sean Brady:
+1

To post to this group, send email to play-f...@googlegroups.com.
To unsubscribe from this group, send email to play-framewo...@googlegroups.com.

Sina Bahram

unread,
Nov 5, 2012, 11:11:06 PM11/5/12
to play-fr...@googlegroups.com

+1

 

Website: www.SinaBahram.com

Twitter: @SinaBahram

 

From: play-fr...@googlegroups.com [mailto:play-fr...@googlegroups.com] On Behalf Of Abhijeet Kumar
Sent: Monday, November 05, 2012 6:37 PM
To: play-fr...@googlegroups.com
Subject: Re: [play-framework] [2.0] logs from test

 

+1

To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/ar87VFbmtSsJ.

dikonikon

unread,
May 22, 2013, 11:43:09 AM5/22/13
to play-fr...@googlegroups.com
I'm using Play 2.1.1 and still experiencing this issue - is it fixed in the version 2.1.1-RC1?

thanks

Dickon

Reid Spencer

unread,
Sep 16, 2013, 1:49:37 PM9/16/13
to play-fr...@googlegroups.com
I am using Play 2.1.4 and this issue still plagues me. I've tried Luka's suggestion below to use a test-logger.xml file. I am currently debugging something that requires my logging lines to be printed so I can debug things.  What prints are logging lines at level "ERROR" and above even though I have my test-logger.xml file setting the level to DEBUG. This forces me to use Logger.error("debug message") kinds of statement which I have to go back and remove later. I'm finding this really annoying. 

So, at this point, I have some questions:
  • Has the original problem with PermGen leaks been resolved?
  • If so, how do you override the logging settings in test mode?
  • If not, how do you tell Play to use a completely different logging infrastructure? (i.e. not Logback)
Thx in advance for any help that can be provided.

On Monday, December 31, 2012 1:57:00 PM UTC, Luka Zakrajšek wrote:
Hi

If you look at Play Logger source[1], you will see that logging is disabled in Test mode.

If you really want logging, you can create logging configuration file for testing and pass it to Play as system property "logger.file".

Example logging configuration (test-logger.xml file in project root):

  <configuration>
    <conversionRule conversionWord="coloredLevel" converterClass="play.api.Logger$ColoredLevel" />
    <logger name="application" level="INFO">
      <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
          <pattern>%coloredLevel %logger{15} - %message%n%xException{5}</pattern>
        </encoder>
      </appender>
    </logger>
  </configuration>

Running tests:

JAVA_OPTS="-Dlogger.file=test-logger.xml" play test


-Luka
Reply all
Reply to author
Forward
0 new messages