2020年7月8日 星期三
NLog
private NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
public ActionResult Index()
{
try
{
int a = 6;
int b = 0;
int result = a / b;
}
catch (Exception ex)
{
GlobalDiagnosticsContext.Set("username", "Jeff");
logger.Error(ex, "testLog");
}
return View();
}
==============
<?xml version="1.0" ?>
<nlog autoReload="true">
<targets>
<target name="database" type="Database">
<!-- database connection parameters -->
<!-- alternatively you could provide a single 'connectionstring' parameter -->
<dbhost>BabyBig-PC</dbhost>
<dbdatabase>ch01</dbdatabase>
<dbusername>xxx</dbusername>
<dbpassword>xxx</dbpassword>
<commandText>
insert into dbo.NLog (
Application, Logged, Level, Message,
Username,
ServerName, Port, Url, Https,
ServerAddress, RemoteAddress,
Logger,Callsite, Exception
) values (
@Application, @Logged, @Level, @Message,
@Username,
@ServerName, @Port, @Url, @Https,
@ServerAddress, @RemoteAddress,
@Logger, @Callsite, @Exception
);
</commandText>
<parameter name="@application" layout="${appsetting:name=AppName:default=Unknown}" />
<parameter name="@logged" layout="${date}" />
<parameter name="@level" layout="${level}" />
<parameter name="@message" layout="${message}" />
<parameter name="@username" layout="${gdc:username}" />
<parameter name="@serverName" layout="${aspnet-request:serverVariable=SERVER_NAME}" />
<parameter name="@port" layout="${aspnet-request:serverVariable=SERVER_PORT}" />
<parameter name="@url" layout="${aspnet-request:serverVariable=HTTP_URL}" />
<parameter name="@https" layout="${when:inner=1:when='${aspnet-request:serverVariable=HTTPS}' == 'on'}${when:inner=0:when='${aspnet-request:serverVariable=HTTPS}' != 'on'}" />
<parameter name="@serverAddress" layout="${aspnet-request:serverVariable=LOCAL_ADDR}" />
<parameter name="@remoteAddress" layout="${aspnet-request:serverVariable=REMOTE_ADDR}:${aspnet-request:serverVariable=REMOTE_PORT}" />
<parameter name="@logger" layout="${logger}" />
<parameter name="@callSite" layout="${callsite}" />
<parameter name="@exception" layout="${exception:tostring}" />
</target>
</targets>
<rules>
<logger name="*" minlevel="Warn" writeTo="database" />
</rules>
</nlog>
2020年4月19日 星期日
Open Source 資源列表
38 Amazing Open Source Android Apps written in Java
https://medium.mybridge.co/38-amazing-android-open-source-apps-java-1a62b7034c40
<Social Networking>
<News>
<Photos & Videos>
<Productivity>
<Music>
<Game>
<Messaging>
<Media>
<Finance>
<Architecture>
<Utilities>
<Reference>
<Weather>
========================================
45 Amazing Node.js Open Source for the Past Year (v.2019)
https://medium.mybridge.co/45-amazing-node-js-open-source-for-the-past-year-v-2019-c774d750e925
Node.js Projects (1~12)
Web Building Tools (13~22)
Node.js Toolkits (23~41)
Server-side Tools (42~45)
=======================================
10 Best Open-Source Projects Built Using PHP
https://www.dunebook.com/best-php-open-source-projects/
1. PHPMailer
2. Design Patterns PHP
3. Platform-Agnostic Security Tokens
4. Faker
5. Craft CMS
6. Churn-PHP
7. Monica
8. PHPUnit Pretty Result Printer
9. Laravel Page Speed
10. PsySH
https://medium.mybridge.co/38-amazing-android-open-source-apps-java-1a62b7034c40
<Social Networking>
<News>
<Photos & Videos>
<Productivity>
<Music>
<Game>
<Messaging>
<Media>
<Finance>
<Architecture>
<Utilities>
<Reference>
<Weather>
========================================
45 Amazing Node.js Open Source for the Past Year (v.2019)
https://medium.mybridge.co/45-amazing-node-js-open-source-for-the-past-year-v-2019-c774d750e925
Node.js Projects (1~12)
Web Building Tools (13~22)
Node.js Toolkits (23~41)
Server-side Tools (42~45)
=======================================
10 Best Open-Source Projects Built Using PHP
https://www.dunebook.com/best-php-open-source-projects/
1. PHPMailer
2. Design Patterns PHP
3. Platform-Agnostic Security Tokens
4. Faker
5. Craft CMS
6. Churn-PHP
7. Monica
8. PHPUnit Pretty Result Printer
9. Laravel Page Speed
10. PsySH
2020年3月13日 星期五
RTOS
1.freertos
https://www.freertos.org/
2.FreeRTOS Real Time Kernel (RTOS)
https://sourceforge.net/projects/freertos/postdownload
1.
2.
3.
4.
5.
6.
7.
8.
BeagleBone Black Uboot (AM3359_BeagleBone_GCC)
OS:Ubuntu 14
sudo apt install git
git clone https://github.com/henfos/BBBFreeRTOS.git
sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
cd BBBFreeRTOS/Demo/AM3359_BeagleBone_GCC
https://launchpad.net/gcc-arm-embedded/+download
chmod 777 gcc-arm-none-eabi-5-4.2016q3-20160926-linux.tar.bz2
tar -xf gcc-arm-none-eabi-5-4.2016q3-20160926-linux.tar.bz2
arm-none-eabi-gcc -v
#include <stdint.h>
CC=arm-none-eabi-gcc
OBJCOPY=arm-none-eabi-objcopy
ARCH=arm-none-eabi-ar
make
1.
2.3.
4.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
訂閱:
文章 (Atom)