• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Doubt on syslog

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Am having a doubt on Promatter Syslog. I have implemented a code on it. But the output was not desire. I would like to make the output for my desire. Actually the output is being like this.

08/16/2007 06:35:07 [INFO] Test Message
08/16/2007 06:39:13 [INFO] Test Message
08/16/2007 06:39:23 [INFO] Test Message

I dont want the extra space to be displayed. I want to display the output to be like this.

08/16/2007 06:35:07 [INFO] Test Message
08/16/2007 06:39:13 [INFO] Test Message
08/16/2007 06:39:23 [INFO] Test Message

It would be helpfut me in the earlier replies.

Thanks & Regards,
Ram
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is Promatter Syslog ?

Anyways both the log snippets look same.
 
Ramkumar Vaitheki
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Please skip the previous mail.

Am having a doubt on Promatter Syslog. I have implemented a code on it. But the output was not desire. I would like to make the output for my desire. Actually the output is being like this.

I dont want the extra space to be displayed. I want to display the output to be like this.

It would be helpfut me in the earlier replies.

Thanks & Regards,
Ram

[ added code tags to preserve spacing - Jim ]
[ August 21, 2007: Message edited by: Jim Yingst ]
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you aware of the location of configuration file which is used to configure the logging system ?
 
Ramkumar Vaitheki
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.. thanks for the reply..i know the configuration file format.. i have it in separate folder. It seems there is no provision for handilng avoid space through configuration file.

FYI, herewith i have provided the Syslog configuration XML which am using

<?xml version="1.0" encoding="UTF-8"?>
<Syslog defaultMask="INFO">
<Logger name="myPrinterLog" class="com.protomatter.syslog.FileLog">
<stream>System.err</stream>
<Format class="com.protomatter.syslog.SimpleSyslogTextFormatter">
<showChannel>false</showChannel>
<showThreadName>false</showThreadName>
<showHostName>false</showHostName>
</Format>
<Policy class="com.protomatter.syslog.SimpleLogPolicy">
<channels>ALL_CHANNEL</channels>
<logMask>INHERIT_MASK</logMask>
</Policy>
<fileName></fileName>
<append>true</append>
<autoFlush>true</autoFlush>
</Logger>
</Syslog>

Hi.. all Please help me out in this regard.

Thanks,
Ram
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have no idea about syslog , but I guess format has something to do with this.


<Format class="com.protomatter.syslog.SimpleSyslogTextFormatter">
<showChannel>false</showChannel>
<showThreadName>false</showThreadName>
<showHostName>false</showHostName>
</Format>

 
Ramkumar Vaitheki
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.. i tried all this way but could not.. Anyone pls try this out
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have a look at the source code for SimpleSyslogTextFormatter, it would appear to put three spaces after the ] before printing the message, so it would appear it's your actual message that has all those spaces. Have you tried String.trim() on your message before logging it ?
 
Ramkumar Vaitheki
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Joanne,

As you print i would have print only 3 spaces it prints a lot spaces. Then i tried trim() but i could not. Anyhow thanks for the reply. Kindly do reply if you have answer.

Hi ranchers please help me out in the reagard

Thanks,
Ram
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ramkumar Vaitheki:
As you print i would have print only 3 spaces it prints a lot spaces.



Yes. That's what I was saying. The logging code only prints three spaces, therefore all the other spaces must be part of the string you are logging

Originally posted by Ramkumar Vaitheki:
Then i tried trim() but i could not.



Do you mean there was some reason you couldn't use trim or that it didn't work ?
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic