发表于: 2017-10-21 20:36:28

1 693


今天完成的事情:

       学习了log4j和tomcat。

在我前面的demo中用log4j

tomcat启动成功

明天计划的事情:

      Spring+Mybatis整合项目。

遇到的问题:

       tomcat打开闪退,需要配置环境变量。

配置CATALINA_HOME:

F:\apache-tomcat-7.0.52

收获:   

tomcat:

startup.bat 启动命令

shutdown.bat 停止命令


log4j其语法为:

log4j.rootLogger = [ level ] , appenderName, appenderName, …

其中,level 是日志记录的优先级,分为OFF、FATAL、ERROR、WARN、INFO、DEBUG、ALL或者自定义的级别。Log4j建议只使用四个级别,优先级从高到低分别是ERROR、WARN、INFO、DEBUG。通过在这里定义的级别,您可以控制到应用程序中相应级别的日志信息的开关。比如在这里定义了INFO级别,只有等于及高于这个级别的才进行处理,则应用程序中所有DEBUG级别的日志信息将不被打印出来。ALL:打印所有的日志,OFF:关闭所有的日志输出。 appenderName就是指定日志信息输出到哪个地方。可同时指定多个输出目的地。


这里记一下linux的常用命令:

关机 (系统的关机、重启以及登出 ) 

shutdown -h now 关闭系统(1) 

init 0 关闭系统(2) 

telinit 0 关闭系统(3) 

shutdown -h hours:minutes & 按预定时间关闭系统 

shutdown -c 取消按预定时间关闭系统 

shutdown -r now 重启(1) 

reboot 重启(2) 

logout 注销 

文件和目录 

cd /home 进入 '/ home' 目录' 

cd .. 返回上一级目录 

cd ../.. 返回上两级目录 

cd 进入个人的主目录 

cd ~user1 进入个人的主目录 

cd - 返回上次所在的目录 

pwd 显示工作路径 

ls 查看目录中的文件 

ls -F 查看目录中的文件 

ls -l 显示文件和目录的详细资料 

ls -a 显示隐藏文件 

ls *[0-9]* 显示包含数字的文件名和目录名 

tree 显示文件和目录由根目录开始的树形结构(1) 

lstree 显示文件和目录由根目录开始的树形结构(2) 

mkdir dir1 创建一个叫做 'dir1' 的目录' 

mkdir dir1 dir2 同时创建两个目录 

mkdir -p /tmp/dir1/dir2 创建一个目录树 

rm -f file1 删除一个叫做 'file1' 的文件' 

rmdir dir1 删除一个叫做 'dir1' 的目录' 

rm -rf dir1 删除一个叫做 'dir1' 的目录并同时删除其内容 

rm -rf dir1 dir2 同时删除两个目录及它们的内容 

mv dir1 new_dir 重命名/移动 一个目录 

cp file1 file2 复制一个文件 

cp dir/* . 复制一个目录下的所有文件到当前工作目录 

cp -a /tmp/dir1 . 复制一个目录到当前工作目录 

cp -a dir1 dir2 复制一个目录 

ln -s file1 lnk1 创建一个指向文件或目录的软链接 

ln file1 lnk1 创建一个指向文件或目录的物理链接 

touch -t 0712250000 file1 修改一个文件或目录的时间戳 - (YYMMDDhhmm) 

file file1 outputs the mime type of the file as text 

iconv -l 列出已知的编码 

iconv -f fromEncoding -t toEncoding inputFile > outputFile creates a new from the given input file by assuming it is encoded in fromEncoding and converting it to toEncoding. 

find . -maxdepth 1 -name *.jpg -print -exec convert "{}" -resize 80x60 "thumbs/{}" \; batch resize files in the current directory and send them to a thumbnails directory (requires convert from Imagemagick) 

文件搜索 

find / -name file1 从 '/' 开始进入根文件系统搜索文件和目录 

find / -user user1 搜索属于用户 'user1' 的文件和目录 

find /home/user1 -name \*.bin 在目录 '/ home/user1' 中搜索带有'.bin' 结尾的文件 

find /usr/bin -type f -atime +100 搜索在过去100天内未被使用过的执行文件 

find /usr/bin -type f -mtime -10 搜索在10天内被创建或者修改过的文件 

find / -name \*.rpm -exec chmod 755 '{}' \; 搜索以 '.rpm' 结尾的文件并定义其权限 

find / -xdev -name \*.rpm 搜索以 '.rpm' 结尾的文件,忽略光驱、捷盘等可移动设备 

locate \*.ps 寻找以 '.ps' 结尾的文件 - 先运行 'updatedb' 命令 

whereis halt 显示一个二进制文件、源码或man的位置 

which halt 显示一个二进制文件或可执行文件的完整路径 



返回列表 返回列表
评论

    分享到