{"id":15318573,"url":"https://github.com/appleboy/codeigniter-log-library","last_synced_at":"2025-04-15T02:28:41.620Z","repository":{"id":6684525,"uuid":"7929575","full_name":"appleboy/CodeIgniter-Log-Library","owner":"appleboy","description":"Store php error or exception logs into database.","archived":false,"fork":false,"pushed_at":"2017-02-05T11:16:24.000Z","size":10,"stargazers_count":61,"open_issues_count":0,"forks_count":23,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-10T08:32:22.289Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appleboy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-31T03:33:07.000Z","updated_at":"2024-09-04T15:01:39.000Z","dependencies_parsed_at":"2022-08-30T20:20:39.583Z","dependency_job_id":null,"html_url":"https://github.com/appleboy/CodeIgniter-Log-Library","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2FCodeIgniter-Log-Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2FCodeIgniter-Log-Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2FCodeIgniter-Log-Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2FCodeIgniter-Log-Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appleboy","download_url":"https://codeload.github.com/appleboy/CodeIgniter-Log-Library/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248993433,"owners_count":21195198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T09:01:33.887Z","updated_at":"2025-04-15T02:28:41.596Z","avatar_url":"https://github.com/appleboy.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeIgniter-Log-Library\n\nStore all php error or exception logs into database.\n\n# Installation\n\nCreate log table on your database. SQL structure is available on ``sql/mysql.sql``\n\n```\n--\n-- Table structure for table `logs`\n--\n\nDROP TABLE IF EXISTS `logs`;\nCREATE TABLE IF NOT EXISTS `logs` (\n  `id` int(11) NOT NULL AUTO_INCREMENT,\n  `errno` int(2) NOT NULL,\n  `errtype` varchar(32) NOT NULL,\n  `errstr` text NOT NULL,\n  `errfile` varchar(255) NOT NULL,\n  `errline` int(4) NOT NULL,\n  `user_agent` varchar(120) NOT NULL,\n  `ip_address` varchar(45) DEFAULT '0' NOT NULL,\n  `time` datetime NOT NULL,\n  PRIMARY KEY (`id`, `ip_address`, `user_agent`)\n) ENGINE=InnoDB  DEFAULT CHARSET=utf8;\n```\n\nYou can install via codeigniter spark or step by step from following instruction.\n\n    $ cp config/log.php your_application/config/\n    $ cp libraries/Lib_log.php your_application/libraries/\n    $ cp controllers/example.php your_application/controllers/\n\nYou can install via http://getsparks.org/packages/codeigniter-log/show\n\n    $ php tools/spark install -v1.0.1 codeigniter-log\n\nFinally excute via command line.\n\n    $ php index.php example\n\n# Usage\n\nload library from spark:\n\n```php\n$this-\u003eload-\u003espark('codeigniter-log/1.0.1');\n```\n\nor load library from codeigniter loader\n\n```php\n$this-\u003eload-\u003elibrary('lib_log');\n```\n\nlog message from trigger_error function.\n\n```php\ntrigger_error(\"User error via trigger.\", E_USER_ERROR);\ntrigger_error(\"Warning error via trigger.\", E_USER_WARNING);\ntrigger_error(\"Notice error via trigger.\", E_USER_NOTICE);\n```\n\nuse php exception:\n\n```php\nthrow new Exception('Error: Division by zero.', E_USER_ERROR);\n```\n\nPlease refer the example controller (``controllers/example.php``).\n\nScreenshot\n\n![mysql log](https://farm9.staticflickr.com/8077/8431391071_7970f8fc05_c.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleboy%2Fcodeigniter-log-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappleboy%2Fcodeigniter-log-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleboy%2Fcodeigniter-log-library/lists"}