Example #1
0
 public static function fdfs_error()
 {
     $err = array('no' => fastdfs_get_last_error_no(), 'info' => fastdfs_get_last_error_info(), 'args' => func_get_args(), 'server_addr' => Core::server_addr());
     MongoLogger::instance()->log('fdfs_error', $err);
     Core::header('x-apiperf-fdfserr: ' . json_encode($err));
     Core::fault(510);
 }
Example #2
0
 public static function instance()
 {
     if (!self::$instance) {
         self::$instance = new MongoLogger();
     }
     return self::$instance;
 }
Example #3
0
  |                                                                                 |
  | 3. All advertising materials mentioning features or use of this software        |
  |    must display the following acknowledgement:                                  |
  |    This product includes software developed by César D. Rodas.                  |
  |                                                                                 |
  | 4. Neither the name of the César D. Rodas nor the                               |
  |    names of its contributors may be used to endorse or promote products         |
  |    derived from this software without specific prior written permission.        |
  |                                                                                 |
  | THIS SOFTWARE IS PROVIDED BY CÉSAR D. RODAS ''AS IS'' AND ANY                   |
  | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED       |
  | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE          |
  | DISCLAIMED. IN NO EVENT SHALL CÉSAR D. RODAS BE LIABLE FOR ANY                  |
  | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES      |
  | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;    |
  | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND     |
  | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT      |
  | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS   |
  | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE                     |
  +---------------------------------------------------------------------------------+
  | Authors: César Rodas <*****@*****.**>                                           |
  +---------------------------------------------------------------------------------+
*/
require "../../lib/ActiveMongo.php";
require "logger.php";
/* Connect */
ActiveMongo::connect("activemongo");
MongoLogger::Init();
/* Generate errors */
fopen("/foo-bar-file", "w");
throw new Exception("error");