Re: [Mojolicious] Mojolicious - how to shut off logging?

651 views
Skip to first unread message

Lance Gropper

unread,
Oct 22, 2013, 7:50:56 PM10/22/13
to mojol...@googlegroups.com
Hello Allan:

For some reason, I seem to be missing something:

MOJO_LOG_LEVEL can not be found as an environment variable. Also, the doc doesn't say how to shut off the log - it only shows how to manually create additional log messages, and how to create a second log. Additionally, where does it log the messages to by default?

Lance


On Tue, Oct 22, 2013 at 11:08 AM, Allan Cochrane <allan.c...@gmail.com> wrote:
Hi,

the environment variable MOJO_LOG_LEVEL might help here, it can control the logger level. Alternatively make a directory called 'log' from where you start morbo and it *ought* to write to a development.log file in that directory.

allan



On Tuesday, 22 October 2013 10:16:28 UTC-5, Statue wrote:
Hello Gabriel:

Got a different type of question: My app is running in real-time - this causes a lot of morbo info and debug messages - is there a way to disable the messages?

Lance



On Wed, Oct 16, 2013 at 11:08 AM, Lance Gropper <streamsc...@gmail.com> wrote:
Problem was my bad - the original PERL variable assignment was in an if statement that wasn't evaluating correctly for some other reason (value that probably needed to be chopped). Thanks again guys.


On Wed, Oct 16, 2013 at 11:02 AM, Lance Gropper <streamsc...@gmail.com> wrote:
Wait - I think I found the problem...Still checking...


On Wed, Oct 16, 2013 at 11:01 AM, Lance Gropper <streamsc...@gmail.com> wrote:
I tried converting it to a string - also made no difference...


On Wed, Oct 16, 2013 at 10:59 AM, Lance Gropper <streamsc...@gmail.com> wrote:
Hello Alexander:
 
No difference...
 
Lance
 


On Wed, Oct 16, 2013 at 10:58 AM, Александр Грошев <aleksande...@gmail.com> wrote:

Try

left: <%= $model =%>%

16.10.2013 21:53 пользователь "Lance Gropper" <streamsc...@gmail.com> написал:
Works fine in the HTML code, just doesn't seem to work in the CSS code. Also, I tried a different approach which didn't work for some reason. I tried putting all of the PERL code outside of the __DATA__, then using it to generate the HTML, putting it all into a single string and putting that into the data statement - that also didn't work, but it was too complicated to figure out why. The reason I was doing that is I wanted to make my code run under Mojo, as well as Webmin.


On Wed, Oct 16, 2013 at 10:50 AM, Stefan Adams <ste...@cogentinnovators.com> wrote:

On Wed, Oct 16, 2013 at 12:47 PM, Lance Gropper <streamsc...@gmail.com> wrote:
There's no space between the 80 and the %, and I tried it with <%= $model %> % (with space) - no difference.

There should be no space, to my knowledge.  So that's bizarre that it isn't working.  I was thinking maybe there was a space and that was keeping it from working.
 
On Wed, Oct 16, 2013 at 10:45 AM, Stefan Adams <ste...@cogentinnovators.com> wrote:



On Wed, Oct 16, 2013 at 12:43 PM, Lance Gropper <streamsc...@gmail.com> wrote:
Hello Gabriel:
 
I have another question: I'm trying to alter CSS code in mojo with in-line substitution. This, for example works:
 
left: 80%
 
This doesn't for some reason (and $model is set to 80):
 
left: <%= $model %>%
 
What did I do wrong?

Look at the source...  Is there a space between 80 and %   ?


--
You received this message because you are subscribed to a topic in the Google Groups "Mojolicious" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mojolicious/1nEI90NiWj4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mojolicious...@googlegroups.com.
To post to this group, send email to mojol...@googlegroups.com.



--
This e-mail and any attachments are intended only for use by the addressee(s) named herein and may contain confidential information. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email and any attachments is strictly prohibited. If you receive this email in error, please immediately notify the sender by return email and permanently delete the original, any copy and any printout thereof. The integrity and security of e-mail cannot be guaranteed. If this email has been forwarded, it may have been altered, invalidating the content.

--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious...@googlegroups.com.

To post to this group, send email to mojol...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Mojolicious" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mojolicious/1nEI90NiWj4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mojolicious...@googlegroups.com.
To post to this group, send email to mojol...@googlegroups.com.



--
This e-mail and any attachments are intended only for use by the addressee(s) named herein and may contain confidential information. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email and any attachments is strictly prohibited. If you receive this email in error, please immediately notify the sender by return email and permanently delete the original, any copy and any printout thereof. The integrity and security of e-mail cannot be guaranteed. If this email has been forwarded, it may have been altered, invalidating the content.



--
This e-mail and any attachments are intended only for use by the addressee(s) named herein and may contain confidential information. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email and any attachments is strictly prohibited. If you receive this email in error, please immediately notify the sender by return email and permanently delete the original, any copy and any printout thereof. The integrity and security of e-mail cannot be guaranteed. If this email has been forwarded, it may have been altered, invalidating the content.



--
This e-mail and any attachments are intended only for use by the addressee(s) named herein and may contain confidential information. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email and any attachments is strictly prohibited. If you receive this email in error, please immediately notify the sender by return email and permanently delete the original, any copy and any printout thereof. The integrity and security of e-mail cannot be guaranteed. If this email has been forwarded, it may have been altered, invalidating the content.



--
This e-mail and any attachments are intended only for use by the addressee(s) named herein and may contain confidential information. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email and any attachments is strictly prohibited. If you receive this email in error, please immediately notify the sender by return email and permanently delete the original, any copy and any printout thereof. The integrity and security of e-mail cannot be guaranteed. If this email has been forwarded, it may have been altered, invalidating the content.



--
This e-mail and any attachments are intended only for use by the addressee(s) named herein and may contain confidential information. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email and any attachments is strictly prohibited. If you receive this email in error, please immediately notify the sender by return email and permanently delete the original, any copy and any printout thereof. The integrity and security of e-mail cannot be guaranteed. If this email has been forwarded, it may have been altered, invalidating the content.

--
You received this message because you are subscribed to a topic in the Google Groups "Mojolicious" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mojolicious/1nEI90NiWj4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mojolicious...@googlegroups.com.
To post to this group, send email to mojol...@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/groups/opt_out.



--
This e-mail and any attachments are intended only for use by the addressee(s) named herein and may contain confidential information. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email and any attachments is strictly prohibited. If you receive this email in error, please immediately notify the sender by return email and permanently delete the original, any copy and any printout thereof. The integrity and security of e-mail cannot be guaranteed. If this email has been forwarded, it may have been altered, invalidating the content.

Allan Cochrane

unread,
Oct 23, 2013, 10:19:44 AM10/23/13
to mojol...@googlegroups.com


On Tuesday, 22 October 2013 18:50:56 UTC-5, Statue wrote:
Hello Allan:

For some reason, I seem to be missing something:

MOJO_LOG_LEVEL can not be found as an environment variable. Also, the doc doesn't say how to shut off the log - it only shows how to manually create additional log messages, and how to create a second log. Additionally, where does it log the messages to by default?

Lance


Hi,

You have to set the MOJO_LOG_LEVEL env, var. before starting morbo, try

export MOJO_LOG_LEVEL=fatal

in your shell, that should turn off all but fatal errors.

Alternatively, you can create a new instance of a logger and tell the application to use it:

my $log = Mojo::Log->new(path => '/var/log/mojo.log', level => 'fatal'); # new log instance
$self->log($log); # tell app to use new log instance

I suppose if you wanted to turn off logging completely you could set the path to /dev/null, but I find that the messages from morbo are useful during development. You should probably look at hypnotoad for use in production.

Allan


Lance Gropper

unread,
Oct 23, 2013, 11:09:31 AM10/23/13
to mojol...@googlegroups.com
Anyone? When I type env, I get:
 
HOSTNAME=raidix
TERM=xterm
SHELL=/bin/bash
HISTSIZE=1000
SSH_CLIENT=192.168.1.67 64367 22
SSH_TTY=/dev/pts/0
USER=root
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
MAIL=/var/spool/mail/root
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
PWD=/root
LANG=en_US.UTF-8
HISTCONTROL=ignoredups
SHLVL=1
HOME=/root
LOGNAME=root
SSH_CONNECTION=192.168.1.67 64367 192.168.1.129 22
LESSOPEN=|/usr/bin/lesspipe.sh %s
G_BROKEN_FILENAMES=1
_=/bin/env
- there are no Mojolicious env values.
 
Lance

Statue

unread,
Oct 23, 2013, 11:13:06 AM10/23/13
to mojol...@googlegroups.com
Doing an export MOJO_LOG_LEVEL=fatal, then starting Mojo:

Server available at http://127.0.0.1:80.
[root@raidix ~]# [Wed Oct 23 08:10:55 2013] [debug] Your secret passphrase needs to be changed!!!
[Wed Oct 23 08:10:55 2013] [debug] GET / (Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; rv:11.0) like Gecko).
[Wed Oct 23 08:10:55 2013] [debug] Rendering template "index.html.ep" from DATA section.
Variable "@splitter" is not available at (eval 232) line 258.
[Wed Oct 23 08:10:55 2013] [debug] 200 OK (0.026958s, 37.095/s).
[Wed Oct 23 08:10:56 2013] [debug] GET / (Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; rv:11.0) like Gecko).
[Wed Oct 23 08:10:56 2013] [debug] Rendering cached template "index.html.ep" from DATA section.
[Wed Oct 23 08:10:56 2013] [debug] 200 OK (0.012572s, 79.542/s).
[Wed Oct 23 08:10:57 2013] [debug] GET / (Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; rv:11.0) like Gecko).
[Wed Oct 23 08:10:57 2013] [debug] Rendering cached template "index.html.ep" from DATA section.
[Wed Oct 23 08:10:57 2013] [debug] 200 OK (0.012591s, 79.422/s).
[Wed Oct 23 08:10:58 2013] [debug] GET / (Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; rv:11.0) like Gecko).
[Wed Oct 23 08:10:58 2013] [debug] Rendering cached template "index.html.ep" from DATA section.
[Wed Oct 23 08:10:58 2013] [debug] 200 OK (0.012799s, 78.131/s).
[Wed Oct 23 08:10:59 2013] [debug] GET / (Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; rv:11.0) like Gecko).
[Wed Oct 23 08:10:59 2013] [debug] Rendering cached template "index.html.ep" from DATA section.
[Wed Oct 23 08:10:59 2013] [debug] 200 OK (0.019006s, 52.615/s).
[Wed Oct 23 08:11:00 2013] [debug] GET / (Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; rv:11.0) like Gecko).
[Wed Oct 23 08:11:00 2013] [debug] Rendering cached template "index.html.ep" from DATA section.
[Wed Oct 23 08:11:00 2013] [debug] 200 OK (0.022975s, 43.526/s).
[Wed Oct 23 08:11:01 2013] [debug] GET / (Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; rv:11.0) like Gecko).
[Wed Oct 23 08:11:01 2013] [debug] Rendering cached template "index.html.ep" from DATA section.

...and on...and on...I got the idea from the documentation that when you set the log level to a particular value, it shows all messages below that level - i.e. fatal shows debug messages, info messages, etc. What I need is to know how to now show any messages whatsoever...

Lance

Lance Gropper

unread,
Oct 23, 2013, 11:19:45 AM10/23/13
to mojol...@googlegroups.com
When I try the second method, I get errors indicating $self is not defined or requires a package name.
 
Lance


--
You received this message because you are subscribed to a topic in the Google Groups "Mojolicious" group.

To unsubscribe from this group and all its topics, send an email to mojolicious...@googlegroups.com.
To post to this group, send email to mojol...@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/groups/opt_out.

Александр Грошев

unread,
Oct 23, 2013, 11:25:36 AM10/23/13
to mojol...@googlegroups.com

You must define $self. Learn perl!

23.10.2013 19:20 пользователь "Lance Gropper" <streamsc...@gmail.com> написал:
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious...@googlegroups.com.

Lance Gropper

unread,
Oct 23, 2013, 11:27:32 AM10/23/13
to mojol...@googlegroups.com
I know perl - I defined $self, and the web page no longer renders. I am switching to a competitors' PERL web server, as you don't know how to make one which is non-blocking and doesn't eventually fill up the boot drive or fill the console with non-stop error messages.
 

Lance Gropper

unread,
Oct 23, 2013, 11:32:46 AM10/23/13
to mojol...@googlegroups.com
Can you at least tell me the location where it saved the default ~4GB log file which is already there?
 

Sebastian Riedel

unread,
Oct 23, 2013, 11:42:49 AM10/23/13
to mojol...@googlegroups.com
I know perl - I defined $self, and the web page no longer renders. I am switching to a competitors' PERL web server, as you don't know how to make one which is non-blocking and doesn't eventually fill up the boot drive or fill the console with non-stop error messages.

Please don't be rude and have a little more patience waiting for answers (a good answer can often take days), spamming a topic and deep quoting have a tendency to scare people away that might otherwise have answered.

P.S.: "PERL" is not a thing, the language is called "Perl" and the executable "perl".

--

Lance Gropper

unread,
Oct 23, 2013, 11:52:50 AM10/23/13
to mojol...@googlegroups.com
Hello Sebastian:
 
I responded to Alexanders' message - it was rude. He called it 'perl'. I wanted to thank you for all of the help you have given me. I just wished others were as willing to help and/or understanding that I haven't seen Mojolicious until about a month ago, and am a beginner. I have written several operating systems in PERL, and was looking to have my next one running under Mojo, but now I'm in a real time-crunch, and really blow my top when I see responses where I ask for help, someone provides answers that aren't working (at least for me), then tells me to learn something (akin to telling me to jump off a cliff). There were some things I really liked about Mojolicious, that this other server I am going to have to switch to doesn't do - I liked how easily you could mix PERL, HTML, and CSS code. But I didn't like how it was blocking and I had to jump through hoops to do some of it (you helped me through most of that). The other problem is this debugging message thing. I appreciate that it helps developers find problems, but it is something that should not be enabled by default. When systems are being deployed with Mojo on it, it becomes more of a hindrance than help at that point.
 
Lance
 


--
You received this message because you are subscribed to a topic in the Google Groups "Mojolicious" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mojolicious/8-vczEexC7E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mojolicious...@googlegroups.com.
To post to this group, send email to mojol...@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/groups/opt_out.

sri

unread,
Oct 23, 2013, 1:00:30 PM10/23/13
to mojol...@googlegroups.com

Learn perl!


Please refrain from rude remarks like this one in the future.

--
sebastian 

Lance Gropper

unread,
Oct 23, 2013, 1:01:24 PM10/23/13
to mojol...@googlegroups.com
I didn't use that remark - Alexander did...
 


--
You received this message because you are subscribed to a topic in the Google Groups "Mojolicious" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mojolicious/8-vczEexC7E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mojolicious...@googlegroups.com.
To post to this group, send email to mojol...@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/groups/opt_out.

Lance Gropper

unread,
Oct 23, 2013, 2:03:15 PM10/23/13
to mojol...@googlegroups.com
Hello Sebastian:

Sri told me to start a different subject, because it was different
from this one, which I did, and in that thread, Alexander posted:

"Add star
Александр Грошев
<aleksande...@gmail.com> Wed, Oct 23, 2013 at 8:25 AM
Reply-To: mojol...@googlegroups.com
To: mojol...@googlegroups.com

Reply | Reply to all | Forward | Print | Delete | Show original



You must define $self. Learn perl!

23.10.2013 19:20 пользователь "Lance Gropper"
<streamsc...@gmail.com> написал:


- Show quoted text -
You received this message because you are subscribed to the Google
Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to mojolicious...@googlegroups.com.
To post to this group, send email to mojol...@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/groups/opt_out.

- Show quoted text -
"

Lance

On 10/23/13, Lance Gropper <streamsc...@gmail.com> wrote:
> I didn't use that remark - Alexander did...
>
>
>
> On Wed, Oct 23, 2013 at 10:00 AM, sri <kra...@googlemail.com> wrote:
>
>> Learn perl!
>>>
>>
>> Please refrain from rude remarks like this one in the future.
>>
>> --
>> sebastian
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Mojolicious" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/mojolicious/8-vczEexC7E/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> mojolicious...@googlegroups.com.
>> To post to this group, send email to mojol...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/mojolicious.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> *This** e-mail and any attachments are intended only for use by the
> addressee(s) named herein and may contain confidential information. If you
> are not the intended recipient of **this** e-mail, you are hereby notified
> any dissemination, distribution or copying of **this** **email** and any
> attachments is strictly prohibited. If you receive **this** **email** in
> error, please immediately notify the sender by return **email** and
> permanently delete the original, any copy and any printout thereof. The
> integrity and security of e-mail cannot be guaranteed. If this email has
> been forwarded, it may have been altered, invalidating the content.*
>


--
*This** e-mail and any attachments are intended only for use by the
addressee(s) named herein and may contain confidential information. If you
are not the intended recipient of **this** e-mail, you are hereby notified
any dissemination, distribution or copying of **this** **email** and any
attachments is strictly prohibited. If you receive **this** **email** in
error, please immediately notify the sender by return **email** and
permanently delete the original, any copy and any printout thereof. The
integrity and security of e-mail cannot be guaranteed. If this email has
been forwarded, it may have been altered, invalidating the content.*

Александр Грошев

unread,
Oct 23, 2013, 2:25:10 PM10/23/13
to mojol...@googlegroups.com

Sorry. I will refrain from such comments in the future. But his way to search of help forced me to make that comment.

23.10.2013 21:00 пользователь "sri" <kra...@googlemail.com> написал:
--

Sebastian Riedel

unread,
Oct 23, 2013, 2:47:25 PM10/23/13
to mojol...@googlegroups.com

Sorry. I will refrain from such comments in the future. But his way to search of help forced me to make that comment.


I understand, and am starting to suspect he might be trolling us.

sri

unread,
Oct 23, 2013, 2:53:14 PM10/23/13
to mojol...@googlegroups.com
Please consider the two threads mentioned in this discussion closed.

--
sebastian
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages