Re: [PHP] static Logging class?

[email protected] (Ravi Gehlot)
Newsgroups php.general
Message-ID <CALftn6wnPkitGFPPrSjuew_tK=hpxKY2YdM7Tr9MX9HCHdz6=g@mail.gmail.com>
Hello Lars,

I would apply the Singleton Pattern where you would have 1 instance for you
entire application. As far as whether or not to use a static method, I
would weigh the options. If you just want to call a method that you know
will not have to be changed in the future and that method will not be using
any pre-defined properties, then it makes sense to call a static method.
Bear in mind that static methods can not be overridden.

Best of luck,

-------------------------------------------------
  [image: logo]
*Ravi Gehlot
*
Mobile: 407-283-5282
Orlando, FL 32765-8085
http://www.RaviGehlot.Net/
https://github.com/ravigehlot

*"First, solve the problem. Then, write the code."*
[image: Twitter] <http://www.twitter.com/ravigehlot> [image:
LinkedIn]<http://www.linkedin.com/in/ravigehlot> [image:
Amazon]<https://www.amazon.com/gp/pdp/profile/A35NGY72YZSFR7?ie=UTF8&ref_=ya_56>
[image:
Meetup] <http://www.meetup.com/members/12029903/> [image:
pinterest]<http://pinterest.com/ravigehlot/> [image:
reddit] <http://www.reddit.com/user/ravigehlot/>
Contact me: [image: Google Talk] ravigehlot [image: Skype] ravigehlot [image:
Y! Messenger] ravigehlot


On Sun, Mar 3, 2013 at 8:26 AM, Lars Nielsen <[email protected]> wrote:

> Hi,
>
> I work on a little hobby-project, and i want to make a oo logging
> facility. (php5.3 oop)
>
> Is it best to make a class with static functions that i can call from my
> other classes? Or is it more appropriate to make a real logging-class i
> should instantiate every time i need to log something? (I just want to
> log to a file)
>
> Best regards
> Lars Nielsen
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.