public function log( $service_name, $log_name, $level, $message, $context = array() )
    {
        $ok = false;

        $tmp_log_path = $this->get_config_value( 'log_path' );
        $log_path = ( $this->get_config_value( 'log_path' ) ) ? $this->get_config_value( 'log_path' ) . '/' . $service_name . '/' : sys_get_temp_dir() . '/' . $service_name . '/';

        if( ! file_exists( $log_path ) )
        {
            mkdir( $log_path, 0755 );
        }

        $log_path .= $log_name . ".log";

        // avoid big file
        $append = false;
        if( file_exists( $log_path ) && filesize( $log_path ) >= 1024 )
        {
            //    unlink( $log_path );
            $append = FILE_APPEND;
        }

        // write
        $context_string = ( (bool) $context ) ? print_r( $context, true ) : '';
        $formated_message = $level . ': ' . $message . ' ( ' . $context_string . ' )';
        $ok = file_put_contents( $log_path, $formated_message, $append );

        return ( $ok === false ) ? false : true;
    }