| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
| 2 |
"https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 3 |
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 4 |
<head> |
| 5 |
<title>LuaLogging: A simple API to use logging features in Lua</title> |
| 6 |
<link rel="stylesheet" href="doc.css" type="text/css"/> |
| 7 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
| 8 |
</head> |
| 9 |
<body> |
| 10 |
|
| 11 |
<div id="container"> |
| 12 |
|
| 13 |
<div id="product"> |
| 14 |
<div id="product_logo"> |
| 15 |
<img alt="LuaLogging logo" src="images/lualogging-128.png"/> |
| 16 |
</div> |
| 17 |
<div id="product_name"><big><strong>LuaLogging</strong></big></div> |
| 18 |
<div id="product_description">A simple API to use logging features in Lua.</div> |
| 19 |
</div> <!-- id="product" --> |
| 20 |
|
| 21 |
<div id="main"> |
| 22 |
|
| 23 |
<div id="navigation"> |
| 24 |
<h1>LuaLogging</h1> |
| 25 |
<ul> |
| 26 |
<li><a href="index.html">Home</a></li> |
| 27 |
<li><a href="manual.html">Manual</a> |
| 28 |
<ul> |
| 29 |
<li><a href="manual.html#installation">Installation</a></li> |
| 30 |
<li><a href="manual.html#logger">Logger objects</a></li> |
| 31 |
<li><a href="manual.html#examples">Examples</a></li> |
| 32 |
</ul> |
| 33 |
</li> |
| 34 |
<li><a href="manual.html#appenders">Appenders</a> |
| 35 |
<ul> |
| 36 |
<li><a href="console.html">Console</a></li> |
| 37 |
<li><a href="file.html">File</a></li> |
| 38 |
<li><a href="rolling_file.html">Rolling File</a></li> |
| 39 |
<li><a href="sql.html">SQL</a></li> |
| 40 |
<li><a href="socket.html">Socket</a></li> |
| 41 |
<li><a href="rsyslog.html">Rsyslog</a></li> |
| 42 |
<li><a href="email.html">Email</a></li> |
| 43 |
<li><strong>Nginx</strong></li> |
| 44 |
</ul> |
| 45 |
</li> |
| 46 |
<li><a href="https://github.com/lunarmodules/lualogging">Project</a></li> |
| 47 |
<li><a href="license.html">License</a></li> |
| 48 |
</ul> |
| 49 |
</div> <!-- id="navigation" --> |
| 50 |
|
| 51 |
<div id="content"> |
| 52 |
|
| 53 |
<h2>Nginx/Openresty appender</h2> |
| 54 |
|
| 55 |
<p>This appender has no configuration options, and simply forwards whatever is |
| 56 |
being logged to the configured Nginx log. LuaLogging log-levels will be converted |
| 57 |
to the equivalent Nginx ones, and initial log-level will be set to match the |
| 58 |
Nginx system level.</p> |
| 59 |
<p>It makes sense to configure this logger and set it as the default logger on |
| 60 |
Nginx/OpenResty startup. Any libraries will then be able to just grab the |
| 61 |
defaultLogger from <code>logging.defaultLogger()</code> and won't need any |
| 62 |
modifications to work with Nginx/OpenResty.</p> |
| 63 |
|
| 64 |
<h2>Examples</h2> |
| 65 |
|
| 66 |
<pre class="example"> |
| 67 |
require("logging.nginx") |
| 68 |
local logging = require("logging") |
| 69 |
|
| 70 |
local logger = logging.nginx() |
| 71 |
logging.defaultLogger(logger) |
| 72 |
|
| 73 |
logger:info("logging.nginx test") |
| 74 |
logger:debug("debugging...") |
| 75 |
logger:error("error!") |
| 76 |
</pre> |
| 77 |
|
| 78 |
<p> </p> |
| 79 |
<p> </p> |
| 80 |
<p> </p> |
| 81 |
<p> </p> |
| 82 |
<p> </p> |
| 83 |
<p> </p> |
| 84 |
<p> </p> |
| 85 |
|
| 86 |
</div> <!-- id="content" --> |
| 87 |
|
| 88 |
</div> <!-- id="main" --> |
| 89 |
|
| 90 |
<div id="about"> |
| 91 |
</div> <!-- id="about" --> |
| 92 |
|
| 93 |
</div> <!-- id="container" --> |
| 94 |
|
| 95 |
</body> |
| 96 |
</html> |