You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Dave Pawson <da...@dpawson.co.uk> on 2005/04/14 19:59:29 UTC

The book. Comments

Sent in a supportive manner.

The examples.
  If run on windows....
 
A batch file, 

cd {wherever}/examples

javac -classpath ..\log4j-1.2.9.jar;. %1\%2.java
java -cp ..\log4j-1.2.9.jar;. %1.%2
type *.log

del *.log


Helps with running the examples.
I can't hack the 'type *.log' to make it work well on Linux.

javac -classpath ../lib/log4j-1.2.9.jar:. $1/$2.java
java -cp ../lib/log4j-1.2.9.jar:. $1.$2

for the basic build.


p24. Bit confused over the levels. Is ALL | OFF included.. or not?
I can't think of a way of expressing it better though.
p28 shows the real hierarchy. That is clear.

p32. English. para 3. Suggest replace 'smaller' with 'less than' as
being (maybe) more usual.

p34. Example 28 title. /AppendEx1 should be /AppenderEx1
p35. Example 29 title. /AppendEx2 should be /AppenderEx2


both these examples. I'd like to have seen (or noticed :-) the 'throws
Exception' 

I tried to add the FileAppender to an existing program, and received the
warning that 'exception  must be caught'.

Perhaps simplify and actually catch the exception? It was a nasty
surprise to me :-) 

(The additive inheritance is very well explained. I liked that)

p36. 'message parameter' (near bottom of page). First usage, has not
been explained. 

p37
Section headed 'A Peek under the hood'. 
  May be of use to some. I found it too advanced for a new user.
Perhaps it should be later in the book?

p39. Terminology. NDC MDC locationInformation. Not mentioned, Undefined,
no reference to API. 

p42. This section left me cold. I have no comprehension of ?? byte
code ??  I'd suggest this is advanced log4j too.


So far so good. Well written and clear. The examples reinforce the text.





-- 
Regards, 

Dave Pawson
XSLT + Docbook FAQ
http://www.dpawson.co.uk


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: The book. Comments

Posted by Ceki Gülcü <ce...@qos.ch>.
Dave,

Thanks for your comments. The obvious mistakes you noted, they'll be 
corrected for the next edition. I'll try to rework the text so that it 
becomes clearer on the other points you raised.


There is a ANT build file to compile the examples. You don't need to invoke 
javac by hand.

At 07:59 PM 4/14/2005, you wrote:
>Sent in a supportive manner.
>
>The examples.
>   If run on windows....
>
>A batch file,
>
>cd {wherever}/examples
>
>javac -classpath ..\log4j-1.2.9.jar;. %1\%2.java
>java -cp ..\log4j-1.2.9.jar;. %1.%2
>type *.log
>
>del *.log
>
>
>Helps with running the examples.
>I can't hack the 'type *.log' to make it work well on Linux.
>
>javac -classpath ../lib/log4j-1.2.9.jar:. $1/$2.java
>java -cp ../lib/log4j-1.2.9.jar:. $1.$2
>
>for the basic build.
>
>
>p24. Bit confused over the levels. Is ALL | OFF included.. or not?
>I can't think of a way of expressing it better though.
>p28 shows the real hierarchy. That is clear.
>
>p32. English. para 3. Suggest replace 'smaller' with 'less than' as
>being (maybe) more usual.
>
>p34. Example 28 title. /AppendEx1 should be /AppenderEx1
>p35. Example 29 title. /AppendEx2 should be /AppenderEx2
>
>
>both these examples. I'd like to have seen (or noticed :-) the 'throws
>Exception'
>
>I tried to add the FileAppender to an existing program, and received the
>warning that 'exception  must be caught'.
>
>Perhaps simplify and actually catch the exception? It was a nasty
>surprise to me :-)
>
>(The additive inheritance is very well explained. I liked that)
>
>p36. 'message parameter' (near bottom of page). First usage, has not
>been explained.
>
>p37
>Section headed 'A Peek under the hood'.
>   May be of use to some. I found it too advanced for a new user.
>Perhaps it should be later in the book?
>
>p39. Terminology. NDC MDC locationInformation. Not mentioned, Undefined,
>no reference to API.
>
>p42. This section left me cold. I have no comprehension of ?? byte
>code ??  I'd suggest this is advanced log4j too.
>
>
>So far so good. Well written and clear. The examples reinforce the text.
>
>
>
>
>
>--
>Regards,
>
>Dave Pawson
>XSLT + Docbook FAQ
>http://www.dpawson.co.uk
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org

-- 
Ceki Gülcü

   The complete log4j manual: http://www.qos.ch/log4j/



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: The book. Comments

Posted by Dave Pawson <da...@dpawson.co.uk>.

p36. mention of 'message parameter' 
  Not explained. Is this the body of the method call?


p39. Mention of NDC, MDC  and LocationInformation. 
Not discussed further, perhaps a reference to the page on which they
are discussed?



p41. Example 2.10 makes reference to chapter3/FactorOut.java
File not provided with my version



p42. Not particularly involved in performance, and never heard of javap.
Is this disassembler output really useful this early.




Chapter 3.

First example output.

My run shows:

[dpawson@marge examples]$ java -cp .:../lib/log4j-1.2.9.jar
chapter3.MyApp1
INFO main chapter3.MyApp1 - Entering application.
0 [main] INFO chapter3.MyApp1  - Entering application.
INFO main chapter3.MyApp1 - Exiting application.
3 [main] INFO chapter3.MyApp1  - Exiting application.
[dpawson@marge examples]$


quite different from the page 46 printout?


regards DaveP.



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: The book. Comments

Posted by Dave Pawson <da...@dpawson.co.uk>.
On Fri, 2005-04-15 at 15:42 +0200, Ceki Gülcü wrote:
> I don't see what you are trying to say. Do you use ant?
> 
> At 08:26 PM 4/14/2005, you wrote:
> >On Thu, 2005-04-14 at 18:59 +0100, Dave Pawson wrote:
> >
> >
> > > I can't hack the 'type *.log' to make it work well on Linux.
> >
> >
> >Just did.
> >
> >  javac -classpath ../lib/log4j-1.2.9.jar:. $1/$2.java
> >  java -cp ../lib/log4j-1.2.9.jar:. $1.$2
> >
> >for i in *.log
> >  do
> >   echo "............File" $i
> >   cat $i
> >  done
> >
> >rm -f *.log


When I started reading, I didn't see how the ant build.xml could work to
build just one  file?

So, working on windows, I wrote the batch file I sent.

When I got home(linux) I then wrote the above script
which handles chapter two examples, which have *.log output?

I keep modifying the examples as I learn, so I wanted to just compile
and run one java file, as I changed it.

That's why I added the 'show log files' part to the script file.

regards DaveP





---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: The book. Comments

Posted by Ceki Gülcü <ce...@qos.ch>.
I don't see what you are trying to say. Do you use ant?

At 08:26 PM 4/14/2005, you wrote:
>On Thu, 2005-04-14 at 18:59 +0100, Dave Pawson wrote:
>
>
> > I can't hack the 'type *.log' to make it work well on Linux.
>
>
>Just did.
>
>  javac -classpath ../lib/log4j-1.2.9.jar:. $1/$2.java
>  java -cp ../lib/log4j-1.2.9.jar:. $1.$2
>
>for i in *.log
>  do
>   echo "............File" $i
>   cat $i
>  done
>
>rm -f *.log
>
>
>HTH DaveP.

-- 
Ceki Gülcü

   The complete log4j manual: http://www.qos.ch/log4j/



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: The book. Comments

Posted by Dave Pawson <da...@dpawson.co.uk>.
On Thu, 2005-04-14 at 18:59 +0100, Dave Pawson wrote:


> I can't hack the 'type *.log' to make it work well on Linux.


Just did.

 javac -classpath ../lib/log4j-1.2.9.jar:. $1/$2.java
 java -cp ../lib/log4j-1.2.9.jar:. $1.$2

for i in *.log
 do
  echo "............File" $i
  cat $i
 done

rm -f *.log


HTH DaveP.




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org