如何使用Notepad++快速整理挤在一起的CallStack信息(将换行符作为被替换的内容)

摘要:
查看起来很不方便。作者总是手动添加换行符。Microsoft.BusinessData.Infrastructure.Bdc异常:

问题描述

=====================

经常需要在SharePoint的ULS日志中捞取一些带有callstack的信息, 而且需要把callstack展开细细查看. 然而, ULS log中的callstack是挤在一起的, 查看起来很不方便.

笔者原来一直手工添加换行符, 但是近期这类工作实在有点多, 于是开始想办法了.

问题举例, 笔者从ULS log中捞到这个CallStack,

Error while executing web part: Microsoft.BusinessData.Infrastructure.BdcException: The shim execution failed unexpectedly - Target application not found (application id: AdventureApp).. ---> Microsoft.Office.SecureStoreService.Server.SecureStoreServiceTargetApplicationNotFoundException: Target application not found (application id: AdventureApp).     at Microsoft.Office.SecureStoreService.Server.SecureStoreServiceApplicationProxy.Execute[T](String operationName, Boolean validateCanary, ExecuteDelegate`1 operation)     at Microsoft.Office.SecureStoreService.Server.SecureStoreServiceApplicationProxy.GetRestrictedCredentials(Guid rawPartitionId, String applicationId)     at Microsoft.Office.SecureStoreService.Server.SecureStoreProvider.GetRestrictedCredentials(String appId)     at Microsoft....
...SharePoint.BusinessData.SystemSpecific.Db.DbConnectionManager.GetConnection()     at Microsoft.SharePoint.BusinessData.SystemSpecific.Db.DbSystemUtility.ExecuteStatic(IMethodInstance methodInstance, ILobSystemInstance lobSystemInstance, Object[] args, IExecutionContext context)     at Microsoft.SharePoint.BusinessData.Runtime.DataClassRuntime.ExecuteInternalWithAuthNFailureRetry(ISystemUtility systemUtility, IMethodInstance methodInstanceToExecute, IMethod methodToExecute, ILobSystemInstance lobSystemInstance, ILobSystem lobSystem, IParameterCollection nonReturnParameters, Object[] overrideArgs)     at Microsoft.SharePoint.BusinessData.Runtime.DataClassRuntime.ExecuteInternal(IDataClass thisDataClass, ILobSystemInstance lobSystemInstance, ILobSystem lobSystem, IMethodInstance methodInstanc...
...eToExecute, IMethod methodToExecute, IParameterCollection nonReturnParameters, Object[]& overrideArgs)     --- End of inner exception stack trace ---     at Microsoft.SharePoint.BusinessData.Runtime.DataClassRuntime.ExecuteInternal(IDataClass thisDataClass, ILobSystemInstance lobSystemInstance, ILobSystem lobSystem, IMethodInstance methodInstanceToExecute, IMethod methodToExecute, IParameterCollection nonReturnParameters, Object[]& overrideArgs)     at Microsoft.SharePoint.BusinessData.Runtime.EntityRuntime.ExecuteInternal(IDataClass thisDataClass, ILobSystemInstance lobSystemInstance, ILobSystem lobSystem, IMethodInstance methodInstanceToExecute, IMethod methodToExecute, IParameterCollection nonReturnParameters, Object[]& overrideArgs, IFilterCollection filters)     at Microsoft.SharePoin...
...t.BusinessData.Runtime.EntityRuntime.ExecuteFiltered(IEntity this, IFilterCollection filterCollection, IMethodInstance methodInstanceToExecute, ILobSystemInstance lobSystemInstance)     at Microsoft.SharePoint.BusinessData.Runtime.EntityRuntime.<FindFiltered>b__3(IEntity e, IMethodInstance mi, IFilterCollection fc, ILobSystemInstance lsi)     at Microsoft.SharePoint.BusinessData.Runtime.EntityInstanceEnumeratorFactory.CreateEntityInstanceEnumerator(IEntity entity, IMethodInstance methodInstance, IFilterCollection filters, ILobSystemInstance lobSystemInstance, ExecutionCallBack executionCallBack)     at Microsoft.SharePoint.BusinessData.MetadataModel.Static.Entity.FindFiltered(IFilterCollection filterCollection, String finderName, ILobSystemInstance lobSystemInstance)     at Microsoft.Share...
...Point.SPListDataSource.GetEntityInstanceEnumerator(XmlNode xnMethodAndFilters)     at Microsoft.SharePoint.SPListDataSource.GetFilteredEntityInstancesInternal(XmlDocument xdQueryView, Boolean fFormatDates, Boolean fUTCToLocal, String firstRowId, Boolean fBackwardsPaging, String& bdcidFirstRow, String& bdcidNextPageRow, List`1& lstColumnNames, Dictionary`2& dictColumnsUsed, List`1& mapRowOrdering, List`1& lstEntityData)     at Microsoft.SharePoint.SPListDataSource.GetFilteredEntityInstances(XmlDocument xdQueryView, Boolean fFormatDates, Boolean fUTCToLocal, String firstRowId, Boolean fBackwardsPaging, String& bdcidFirstRow, String& bdcidNextPageRow, List`1& lstColumnNames, Dictionary`2& dictColumnsUsed, List`1& mapRowOrdering, List`1& lstEntityData)     at Microsoft.SharePoint.SPListItemCol...
...lection.EnsureEntityDataViewAndOrdering(String& bdcidFirstRow, String& bdcidNextPageFirstRow)     at Microsoft.SharePoint.SPListItemCollection.EnsureListItemsData()     at Microsoft.SharePoint.SPListItemCollection.get_Count()     at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteSelect(DataSourceSelectArguments selectArguments, String aggregateString, Boolean wantReturn, BaseXsltListWebPart webpart, SPListItem& listItem, SPListItemCollection& listItems, String[]& fieldList)     at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigatorInternal()     at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigator()     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)

研究

=====================

在Notepad++中新建一个文件, 随便输入几行文字

image

点击下面的选项

image

结果如下, 显然CR, LF是换行符.

image

使用CR, LF, Notepad++作为关键字, 经过搜索, 在Notepad++的官网上找到了如下的文字:

Ctrl+H with Extended option selected instead of Regexp. Search for "\r\n", or whatever your OS uses, and replace with what you need. It will replace the newline characters with what you entered. Note that Windows uses CR-LF newlines (\r\n), old Mac uses CR (\r) and Unix uses LF (\n). You can use View -> Show Symbol -> Show End Of Line to see which characters your file uses - files from other OSes may not behave as you expect because they have a different newline type.

Some examples: - To add a string to the end of all lines in Windows, in Ctrl+H with Extended mode enabled, replace \r\n with string\r\n - To add a string to the beginning of all lines in windows, in Ctrl+H with Extended mode enabled, replace \r\n with \r\nstring - To remove extra blank lines in windows, in Ctrl+H with Extended mode enabled, replace \r\n\r\n with \r\n - To remove all newlines, in Ctrl+H with Extended mode enabled, replace \r\n with nothing.

解决方案

=====================

使用Notepad++, 将内容贴入:

image

呼出替换对话框, 将<at>替换为<\r\nat>, 不包括尖括号.

image

结果如下:

image

就用这个技巧作为开端吧, 善用notepad++, 让工作效率疾驰如飞.

参考资料

=====================

How To Replace Line Ends, thus changing the line layout

http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Replacing_Newlines

Replace a "comma space" with a new line in notepad++

http://pressf1.co.nz/showthread.php?t=91763

免责声明:文章转载自《如何使用Notepad++快速整理挤在一起的CallStack信息(将换行符作为被替换的内容)》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇MIPI协议学习总结(一)【转】android的activity被杀死后如何重启下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

IDA破解最简单的登陆框

原创文章,转载请注明出处:http://www.cnblogs.com/justinzhang/       还记得当年本科的时候,一大群人围着一个国安的登陆框在哪儿破解。其实自己对安全方面的东西了解的非常的少,最近遇到一个非常牛逼的UML工具,可惜没有源代码、没有文档,在这种霸道的封杀之下,又点燃了学习反汇编&破解的热情。虽然这是一个非常非常简单...

spark的bulkload报错及解决

需求 将HDFS上的数据解析出来,然后通过hfile方式批量写入Hbase(需要多列写入) 写入数据的关键api: rdd.saveAsNewAPIHadoopFile( stagingFolder, classOf[ImmutableBytesWritable], classOf[KeyValue],...

使用dom4j解析xml文件,并封装为javabean对象

See Also:http://blog.csdn.net/tao_sun/article/details/12452167 延伸: /** * 将xml内容封装到Vehicle对象中 * @param resultXML 内容为String格式的xml * @return */ @SuppressW...

Quartz 设置一个半小时任务实现

该文章属于本人原创,转载请注明出处。   spring + Quartz 设置定时任务时要求没一个半小时执行一次   设置两个相同的定时任务   第一个从整点开始每三小时执行一次              <!--每三小时执行一次任务,从整点开始-->        <propertyname="cronExpression"valu...

Oracle字段转字符串/多行记录合并/连接/聚合字符串的几种方法

原文:http://czjxdm.iteye.com/blog/466948 Oracle字段转字符串/多行记录合并/连接/聚合字符串的几种方法 博客分类:技术文章 OracleSQL  怎么合并多行记录的字符串,一直是oracle新手喜欢问的SQL问题之一,关于这个问题的帖子我看过不下30个了,现在就对这个问题,进行一个总结。    什么是合并多...

使用eclipse将maven项目部署tomcat, 以及如何实现热部署

在以前,我每次部署项目的时候都是关闭tomcat并开启tomcat,完成代码的编译并部署到tomcat上,现在想想,感觉当时怎么不去了解去如何部署到tomcat有几种方式,elispe 创建的web项目部署到tomcat的原理。若是了解了,估计很多时间都不会停留在关闭和开启tomcat上吧,当然这里也是说说而已。 目前,我是想把maven项目web工程部署...